1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-23 18:02:29 +00:00
gists/repos/Load the requirements from requirements.txt into your setup.py/setup.py
2021-10-30 15:16:04 +02:00

9 lines
295 B
Python

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]