pip-compile-multi
pip-compile-multi copied to clipboard
Pull requirements from pyproject.toml
I have a project that is using flit and PEP 621 configuration for declaring dependencies. I'd like to be able to use pip-compile-multi to generate minimal compatible requirements files for it.
Currently, I have a script
pip-compile -q --allow-unsafe pyproject.toml -o requirements/base.txt
pip-compile -q --allow-unsafe pyproject.toml --extra test -o requirements/test.txt
pip-compile -q --allow-unsafe pyproject.toml --extra dev --extra test -o requirements/dev.txt
for pinning the requirements, but I'd prefer to use pip-compile-multi in some way, so:
- the requirements files don't have duplication
- there are no conflicts between the generated requirements.
I'm not using pyproject.toml in any of my projects, but I see the value in the standard. Having pip-compile-multi parse input requirements from pyproject.toml makes sense to me. I can see it as an extra option --pyproject pyproject.toml. Would you be interested in exploring this feature?
Yes, absolutely. I don't use flit but followed the official packaging tutorial which promotes the usage of pyproject.toml and declaring dependencies inside it.
I would even suggest that pip-compile-multi read it by default, and then tries to find requirements/base.in as a fallback. What do you think about this approach?
Cf https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#dependencies-optional-dependencies
I'd be interested in this feature too, thumbs up from me 👍 We are using Hatch, in case you need to know.
I'm all for this, but don't have time to implement it. I can review/merge a PR and make a release, though.
I'm willing to look into this but can't promise to have enough time for this either. So no stress. Btw, great project 😊 Makes it a lot easier to manage multiple environments 👍