Skip to content

Instantly share code, notes, and snippets.

@ibqn
Last active March 12, 2020 10:14
Show Gist options
  • Save ibqn/93bee524d662f3a17c732ccd6628c4b3 to your computer and use it in GitHub Desktop.
Save ibqn/93bee524d662f3a17c732ccd6628c4b3 to your computer and use it in GitHub Desktop.
pip freeze | grep -v "pkg-resources" | sort > frozed-requirements.txt
truncate -s 0 hashed-requirements.txt
while read p
do
echo "$p"
hashin "$p" --requirements-file=hashed-requirements.txt
done < frozed-requirements.txt
# https://pip.pypa.io/en/stable/user_guide/#repeatability
# https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
# https://stackoverflow.com/questions/39577984/what-is-pkg-resources-0-0-0-in-output-of-pip-freeze-command
# https://github.com/peterbe/hashin
python3 -m venv './venv'
source './venv/bin/activate'
pip install --upgrade pip
pip install --upgrade --requirement './requirements.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment