-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description
I am using pip-tools to compile requirements from pyproject.toml and write to requirements.txt files.
A once task to pip-compile the requirements, e.g.
[tool.thx.jobs.pip-compile]
run = "pip-compile -o requirements/dev.txt --extra dev --generate-hashes pyproject.toml"
once = truehas the drawback that some requirements are specified as
exceptiongroup; python_version<3.11
and these requirements will only be pinned if this task is run on an interpreter older than 3.11. once = true runs on the highest version, so will typically fail to pin things.
once = true might be better to run on the lowest version, but really, the only correct solution is to pin dependencies for each interpreter. However this will require being able to substitute the python_version into the requirements:
[tool.thx]
python_versions = ["3.12", "3.11", "3.10"]
# Requirements to use for all jobs
requirements = ["requirements/dev-{python_version}.txt"]
[tool.thx.jobs.pip-compile]
run = "pip-compile -o requirements/dev-{python_version}.txt --extra dev --generate-hashes pyproject.toml"Details
- OS: Linux
- Python version: 3.12
- thx version: 0.6.0
- Can you repro on main? Yes
- Can you repro in a clean virtualenv? Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels