group packages correctly when exporting#5154
Closed
dimbleby wants to merge 1 commit intopython-poetry:masterfrom
Closed
group packages correctly when exporting#5154dimbleby wants to merge 1 commit intopython-poetry:masterfrom
dimbleby wants to merge 1 commit intopython-poetry:masterfrom
Conversation
Contributor
Author
|
The CI pipeline points out that bug 2 is new since poetry-core 1.1.0a6. I had been testing locally with master |
fff771e to
5b124b1
Compare
Contributor
Author
|
The natural way to approach bug 1, I think, would be to introduce an entry in poetry.lock for the top-level package, recording its dependencies. (This is how Cargo.lock works in rust-world). I don't have a sense of how breaking that would be... |
Contributor
Author
|
superseded by #5156 |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Check List
Resolves: #issue-number-here
The attempt to
groupbyduring exports can be foiled by cases where a dependency is present with more than one version: eg if we see[foo 1, foo 2, foo 1]then we end up with three groups rather than two.This improves #5141, in particular the lines for click that we now get for the example given there are
which looks acceptable.
However, in the effort to simplify this to a testcase I ran into at least two bugs that I don't know how to fix, and these are exhibited by the testcase...
Bug 1
Here's what we get for
click:two of the 7.1.2 possibilities overlap the 8.0.3 marker, which is not OK.
The cause seems to be that when the export code comes to process the "top-level" entries for click-didyoumean and click-plugins it sees that these should be installed for a broad range of python versions, and decides that therefore so should their dependency click.
As best I can see the fundamental problem is that the lock file does not record which packages are actually top-level dependencies, and which are not. I don't see how to fix this without recording the actual top-level requirements as taken from
pyproject.toml, which would allow the export code to reach click-didyoumean and click-plugins only in a path where it is taking account of parent markers.Bug 2
The output markers for click-plugins and click-didyoumean (sort of) are also faulty in the test.
The new problem here is that the marker setter at https://github.com/python-poetry/poetry-core/blob/0113a5a172e57424dbf5b2031d8c77097c725b5e/src/poetry/core/packages/dependency.py#L161 does not update the python versions correctly:
python_versionsin the Any marker, and therefore does not clear "python < 3.7" from the_python_versions