You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To obtain this result upon running the second command:
gregdan3@Theros ~/temp> pdm add git+https://github.com/gregdan3/pdm-name-example.git@depextra-b#egg=depextra-b -vv
Adding packages to default dependencies: depextra-b
======== Start resolving requirements ========
depextra-a @ git+https://github.com/gregdan3/pdm-name-example.git@depextra-a
depextra-b @ git+https://github.com/gregdan3/pdm-name-example.git@depextra-b
Adding requirement depextra-a @ git+https://github.com/gregdan3/pdm-name-example.git@depextra-a
Preparing isolated env for PEP 517 build...
Requirement already satisfied: pdm-pep517 in /usr/lib/python3.9/site-packages (from -r /tmp/pdm-build-reqs-2hn034nm.txt (line 1)) (0.5.7)
- Adding depextra_a-1.0.0_.dist-info/WHEEL
- Adding depextra_a-1.0.0_.dist-info/METADATA
- Adding depextra_a-1.0.0_.dist-info/RECORD
Adding requirement depextra-b @ git+https://github.com/gregdan3/pdm-name-example.git@depextra-b
Preparing isolated env for PEP 517 build...
Requirement already satisfied: pdm-pep517 in /usr/lib/python3.9/site-packages (from -r /tmp/pdm-build-reqs-5rkryxnb.txt (line 1)) (0.5.7)
- Adding depextra_b-1.0.0_.dist-info/WHEEL
- Adding depextra_b-1.0.0_.dist-info/METADATA
- Adding depextra_b-1.0.0_.dist-info/RECORD
Adding requirement requests[socks]~=2.25(from depextra-b 1.0.0:)
Resolving: depextra-b 1.0.0:
New pin: depextra-b 1.0.0:
======== Ending round 0 ========
Adding requirement requests[security]~=2.25(from depextra-a 1.0.0:)
Traceback (most recent call last):
File "/home/gregdan3/.local/bin/pdm", line 8, in <module>
sys.exit(main())
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 76, in __call__
return self.main(*args, **kwargs)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 131, in main
raise err.with_traceback(traceback)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/core.py", line 127, in main
f(options.project, options)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/commands/add.py", line 35, in handle
actions.do_add(
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 175, in do_add
resolved = do_lock(project, strategy, tracked_names, reqs)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/cli/actions.py", line 70, in do_lock
mapping, dependencies, summaries = resolve(
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/resolver/core.py", line 152, in resolve
result = resolver.resolve(requirements, max_rounds)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 347, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "/home/gregdan3/.local/pipx/venvs/pdm/lib/python3.9/site-packages/resolvelib/resolvers.py", line 221, in _attempt_to_pin_criterion
raise InconsistentCandidate(candidate, criterion)
resolvelib.resolvers.InconsistentCandidate: Provided candidate <Candidate depextra-a 1.0.0:> does not satisfy <VcsRequirement depextra-a @ git+https://github.com/gregdan3/pdm-name-example.git@depextra-a>
Actual behavior
Dependency resolution fails when the two packages, having a common dependency but with a different optional dependency specification, are installed separately.
Expected behavior
Dependency resolution will not fail with common dependencies using different optional dependencies, regardless of how they are installed.
i.e. pdm add [package1] && pdm add [package2] should have the same final result as pdm add [package1] [package2], but the former fails and the latter does not.
frostming
changed the title
Dependency resolver doesn't union optional dependencies within dependencies under some circumstances
VCS requirements don't match the candidates locked in the pdm.lock
Mar 19, 2021
Steps to reproduce
requests[socks]
, and another with a dependency onrequests[security]
pdm add [package1]
pdm add [package2]
InconsistentCandidate
You can use the following
pyproject.toml
:And the following commands:
To obtain this result upon running the second command:
Actual behavior
Dependency resolution fails when the two packages, having a common dependency but with a different optional dependency specification, are installed separately.
Expected behavior
Dependency resolution will not fail with common dependencies using different optional dependencies, regardless of how they are installed.
i.e.
pdm add [package1] && pdm add [package2]
should have the same final result aspdm add [package1] [package2]
, but the former fails and the latter does not.Environment Information
I prepared the following Dockerfile to demonstrate:
The text was updated successfully, but these errors were encountered: