Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull requirements from pyproject.toml #283

Open
tomprince opened this issue Sep 7, 2021 · 5 comments
Open

Pull requirements from pyproject.toml #283

tomprince opened this issue Sep 7, 2021 · 5 comments

Comments

@tomprince
Copy link

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.
@peterdemin
Copy link
Owner

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?

@cbenz
Copy link

cbenz commented Mar 6, 2023

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

@lord-haffi
Copy link

I'd be interested in this feature too, thumbs up from me 👍
We are using Hatch, in case you need to know.

@peterdemin
Copy link
Owner

I'm all for this, but don't have time to implement it. I can review/merge a PR and make a release, though.

@lord-haffi
Copy link

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 👍

@peterdemin peterdemin changed the title Provide a way to use the requirements merging for requirements that don't come from files. Pull requirements from pyproject.toml Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants