Skip to content

Instantly share code, notes, and snippets.

@kushaldas
Created November 3, 2021 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kushaldas/d8f566067e12d30185abe0f8442d72ef to your computer and use it in GitHub Desktop.
Save kushaldas/d8f566067e12d30185abe0f8442d72ef to your computer and use it in GitHub Desktop.
For installing with pinning

For the project you want to build via lektor, or install lektor for.

Create a requirements.in file with the following content:

lektor

Add any other dependencies there.

Then create a requirements.txt file with the pinned hashes, remember to do it in a same environment, for example using Python3.7 on Debian 10.

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install pip-tools # This is being downloaded directly from PyPI.
pip-compile --generate-hashes --allow-unsafe --output-file=requirements.txt requirements.in

Commit the requiremnts.* files in your project.

Now, in the virtualenv you are actually installing the project, or say lektor, you can use the follwing command to verify that pinning is being used.

python -m pip install --require-hashes -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment