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

poetry install --only-root incorrectly requires presence of path dependencies #6748

Closed
4 tasks done
bplotnick opened this issue Oct 8, 2022 · 4 comments
Closed
4 tasks done
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@bplotnick
Copy link

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Given a path dependency ../bar, when installing using poetry install --only-root, poetry fails with Directory ../bar does not exist, even though that should be irrelevant. I am hitting this issue with multi-stage docker builds where I do poetry install --no-root in one stage to install the deps, and then poetry install --only-root in the next stage to install the app.

This is related to #936 (and associated issues), but I think this issue is a little bit more targeted. Feel free to close as a dupe if you disagree.

@bplotnick bplotnick added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 8, 2022
@neersighted
Copy link
Member

Not a bug -- this is currently as designed. As Poetry locks universally all deps need to be available even if they are not installed.

Softening the validation to allow missing path deps has been discussed, but that would only allow install when a lock file exists, and would lead to inconsistency in installability as such.

A PR relaxing this and adding a useful explanation of why a lock is needed to install with missing path deps could be considered, but no one in core has had any issues with this design/expressed an interest in pushing it themselves.

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 8, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2022
@bplotnick
Copy link
Author

bplotnick commented Oct 8, 2022 via email

@neersighted
Copy link
Member

The install operation is designed and documented as creating the lock if it doesn't exist. While it may be possible to calculate metadata without generating the full lock, we'd have to redesign or bypass many layers of existing abstractions. If we allowed only-root to not have a lock, we'd likely have to do it at the same time or after the FR for --no-root with no pyproject.toml as the same large scale refactoring of of internals would be required.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

2 participants