Reputation: 2391
pip-compile
enables traceability in pinning requirements inside a requirements.txt
with an external requirements.in
. I really like this
My question is, can we somehow do the same, but for an install_requires
list inside setup.py
?
In other words, if I don't have a requirements.txt
but instead just a setup.py
, is it possible to use pip-compile
?
Upvotes: 1
Views: 1188
Reputation: 989
Yes, pip-tools supports pyproject.toml
, setup.cfg
, and setup.py
configuration files from version 6.1.0 (2021-04-14).
You should just run:
pip-compile -o requirements.txt YOUR_CONFIG_FILE
# where YOUR_CONFIG_FILE can be a setup.py
# or even simpler
pip-compile YOUR_CONFIG_FILE
Take a look at the documentation:
Requirements from pyproject.toml
Requirements from setup.py and setup.cfg
Changelog, verson 6.1.0 (2021-04-14)
Upvotes: 2