-
-
Save ScottJWalter/438557f840144fad487347c8d3abe0d2 to your computer and use it in GitHub Desktop.
Fabric api to upgrade or freeze pip packages
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
| from fabric.api import local | |
| import pip | |
| def freeze (): | |
| local("pip freeze > requirements.txt") | |
| local("git add requirements.txt") | |
| local("git commit -v") | |
| def upgrade (): | |
| for dist in pip.get_installed_distributions(): | |
| local("pip install --upgrade {0}".format(dist.project_name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment