-
-
Notifications
You must be signed in to change notification settings - Fork 629
Closed
Labels
extrasHandling optional dependenciesHandling optional dependencies
Description
I'm trying to move away from *.in
files and manage everything from pyproject.toml, but I'm facing a problem where pip-compile --extra
doesn't take into account the already pinned versions from pip-compile
(without --extra).
Environment Versions
- OS Type: Arch Linux
- Python version: 3.11.3
- pip version: pip 23.1.2 from /usr/lib/python3.11/site-packages/pip (python 3.11)
- pip-tools version: 6.13.0
Steps to replicate
- Create the following
pyproject.toml
:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "foobar"
version = "1"
dependencies = ["django==4.1.7"]
[project.optional-dependencies]
dev = ["pytest"]
- Execute
pip-compile --no-header --no-annotate --resolver backtracking
to obtain:
asgiref==3.7.2
django==4.1.7
sqlparse==0.4.4
- Remove the restriction from the
django
dependency from thepyproject.toml
, and verify thatpip-compile
doesn't update any package. - Execute
pip-compile --no-header --no-annotate --resolver backtracking --extra dev -o dev-requirements.txt
, and see that thedjango
dependency has been updated in thedev-requirements.txt
:
asgiref==3.7.2
django==4.2.2
iniconfig==2.0.0
packaging==23.1
pluggy==1.2.0
pytest==7.4.0
sqlparse==0.4.4
I also tried to pass --pip-args "-c requirements.txt"
, but nothing changed.
Expected result
Actually, I would expect a way to pin only the dev dependencies, since the main dependencies were already pinned. Some workflow similar to the Workflow for layered requirements but with pyproject.toml
instead of *.in
files.
borisnaydis
Metadata
Metadata
Assignees
Labels
extrasHandling optional dependenciesHandling optional dependencies