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

Adding support for python_version #30

Open
IlyaMichlin opened this issue Jan 1, 2023 · 0 comments
Open

Adding support for python_version #30

IlyaMichlin opened this issue Jan 1, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request stale

Comments

@IlyaMichlin
Copy link

Sometimes (like in my case) there are different requirements.txt files for different python versions. Currently the only way to enforce package installation based on python version is in the requirements.txt file level i.e.:
requirements.txt

numpy==1.22.0; python_version>="3.8"
pandas==1.5.0; python_version>="3.8"

requirements-python-37.txt

numpy==1.18.0; python_version<"3.8"
pandas==1.0.0; python_version<"3.8"

It will be much cleaner setting the python_version on the hatch level similar to this:

files = [
    { file = "requirements.txt", python_version = ">=3.8" },
    { file = "requirements-python-37.txt", python_version = "<3.8" }
]

And add this capability to [tool.hatch.metadata.hooks.requirements_txt] as well as to [tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]

@IlyaMichlin IlyaMichlin added the enhancement New feature or request label Jan 1, 2023
@stale stale bot added the stale label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants