-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Always re-solve directory dependencies #6843
Conversation
cf #3783 |
@dimbleby thank you for linking to the related issues. Please let me know what you think this PR needs, in particular if we want any tests I would appreciate some guidance along the lines of "please write a test similar to this existing test in this test file" since I'm having a little bit of trouble figuring out what the testing strategy is for the project. |
A test may look similar to poetry/tests/puzzle/test_solver.py Lines 3467 to 3468 in 5c578a2
(except that the directory dependency is updated even if a prior version is locked). |
@radoering test added, thanks for the pointer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a closer look at the show
command, I came to the conclusion that we don't want to re-solve path dependencies in any case. We only want to re-solve when refreshing the lock file but not when solving for a specific environment for show
.
I think we have to try another approach: We shouldn't touch get_locked()
but add path dependencies to use_latest
when refreshing the lock file. If you want to try that approach, this should be the place to add packages with source type "directory" to use_latest
:
poetry/src/poetry/installation/installer.py
Line 207 in 4a07b5e
ops = solver.solve(use_latest=[]).calculate_operations() |
6aed0a2
to
36088ff
Compare
@radoering ok I think I got that approach to work, thanks for the feedback! |
This resolves an issue poetry lock --no-update does not recognize updates made to a path dependency because it treats it as immutable
54b83d5
to
11600e3
Compare
@radoering thank you! |
Thanks for fixing this @adriangb! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Resolves #3783
This resolves an issue poetry lock --no-update does not recognize updates made to a path dependency because it treats it as immutable
@neersighted this works in practice on a real project, but I'm a bit at a loss as to where to add this. I think it should go in
test_solver.py
, but I think I'd have to re-create the dependencies manually by adding them to the repo, which seems tedious. Might need a bit of guidance there.