Created
March 13, 2015 22:25
-
-
Save balkian/b8154c52bde270d34718 to your computer and use it in GitHub Desktop.
Load the requirements from requirements.txt into your setup.py
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 pip.req import parse_requirements | |
# parse_requirements() returns generator of pip.req.InstallRequirement objects | |
install_reqs = parse_requirements("requirements.txt") | |
# reqs is a list of requirement | |
# e.g. ['django==1.5.1', 'mezzanine==1.4.6'] | |
reqs = [str(ir.req) for ir in install_reqs] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest version of pip requires a 'session':