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
I see that this has been brought up before in #464, but am not sure what the final conclusion is for pdm 2+. Currently PDM is unable to add editable packages outside of the project's directory (aka ${PROJECT_ROOT}).
This can be reproduced given the following fictitious package structure:
[tool.pdm.dev-dependencies]
dev = [
"-e file:///${PROJECT_ROOT}/../project-b",
]
This causes a failure similar to below during pdm install, on pdm 2.1.3.
Traceback (most recent call last):
File "/Users/maestro/.asdf/installs/python/3.7.13/bin/pdm", line 8, in <module>
sys.exit(main())
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/core.py", line 254, in main
return Core().main(args)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/core.py", line 187, in main
raise cast(Exception, err).with_traceback(traceback)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/core.py", line 182, in main
f(options.project, options)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/cli/commands/install.py", line 69, in handle
hooks=hooks,
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/cli/actions.py", line 203, in do_sync
candidates = resolve_candidates_from_lockfile(project, requirements)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/cli/actions.py", line 150, in resolve_candidates_from_lockfile
resolve_max_rounds,
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/resolver/core.py", line 30, in resolve
result = resolver.resolve(requirements, max_rounds)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/resolvelib/resolvers.py", line 373, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/resolvelib/resolvers.py", line 203, in _get_updated_criteria
for requirement in self._p.get_dependencies(candidate=candidate):
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/resolver/providers.py", line 180, in get_dependencies
deps, requires_python, _ = self.repository.get_dependencies(candidate)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/models/repositories.py", line 426, in get_dependencies
reqs, python, summary = super().get_dependencies(candidate)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/models/repositories.py", line 70, in get_dependencies
requirements, requires_python, summary = getter(candidate)
File "/Users/maestro/.asdf/installs/python/3.7.13/lib/python3.7/site-packages/pdm/models/repositories.py", line 418, in _get_dependencies_from_lockfile
return self.candidate_info[self._identify_candidate(candidate)]
KeyError: ('project-b', None, 'file:///${PROJECT_ROOT}/../project-b', True)
Expected behavior
In this case I would expect pdm to properly resolve the relative path without failure.
I understand that you can get around this by using symlinks and possibly other clever file path magic, but it would be nice if relative editable installs worked with pdm by default, as many other project do seem to support this capability (pipenv and poetry AFAIK)
What is the expected behavior here? Is there a suggested way to manage interproject dependencies with PDM that I may have missed?
The text was updated successfully, but these errors were encountered:
I see that this has been brought up before in #464, but am not sure what the final conclusion is for pdm 2+. Currently PDM is unable to add editable packages outside of the project's directory (aka
${PROJECT_ROOT}
).This can be reproduced given the following fictitious package structure:
And the
pyproject.toml
in project-a includes:This causes a failure similar to below during
pdm install
, on pdm 2.1.3.Expected behavior
In this case I would expect pdm to properly resolve the relative path without failure.
I understand that you can get around this by using symlinks and possibly other clever file path magic, but it would be nice if relative editable installs worked with pdm by default, as many other project do seem to support this capability (pipenv and poetry AFAIK)
What is the expected behavior here? Is there a suggested way to manage interproject dependencies with PDM that I may have missed?
The text was updated successfully, but these errors were encountered: