with codecs.open('requirements.txt') as f:
requirements = f.read().splitlines()
...
install_requires=requirements,
I don't think it's worth the dependency. But perhaps for others it is.In case anyone sees this, at a minimum you need to use
from pip.req import parse_requirements
parse_requirements('path/to/requirements.txt')
to be safe here.from my understanding, when you build the package, your computer extracts the relevant required packages, and sends up that data to pypi, which then in turn sends that data back to users when they install
At least thats how I think it works
if you used any other package manager, it would need to resolve dependencies from the additional info in the package index, resulting in pip being downloaded and installed before the desired package is installed
If you control requirements.txt, there is nothing "not robust" about parsing it in setup.py.
You can also use `dependency_links` in your setup.py to specify this, which allows deps on github etc.
Define my dependencies
- setup.py
- requirements_dev.in
run piptools pip-compile to generate a locked set of dependencies
- requirements.txt
- requirements_dev.txt
It gives me some of the benefit of Rust's Cargo.toml / Cargo.lock in the python world (and actually respects all package's dependency version declarations unlike other tools like pyup).