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?
Yes, pip-tools supports
pyproject.toml,setup.cfg, andsetup.pyconfiguration files from version 6.1.0 (2021-04-14).You should just run:
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)