Created
July 2, 2020 09:22
-
-
Save ddugovic/82029aecc011c0fa4bac3ede32821586 to your computer and use it in GitHub Desktop.
Generate requirements.txt from pipfile.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# https://github.com/pypa/pipenv/issues/3493#issuecomment-651148507 | |
cat Pipfile.lock \ | |
| grep -B1 '"hashes"\|"version": ' \ | |
| grep -v '"markers": \|"hashes": ' \ | |
| grep ": {\|version" \ | |
| sed -e 's/: {$//g' \ | |
| tr '\n' ',' | tr -s ' ' ' ' \ | |
| sed -e 's/, "version": "//g;s/", "/ /g;s/"//g;s/,//g' \ | |
| tr ' ' '\n' \ | |
| grep -v "^$" > requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment