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

Do not consider constraints when checking for equality of direct origi… #405

Merged
merged 2 commits into from
Jul 3, 2022

Conversation

Jinior
Copy link
Contributor

@Jinior Jinior commented Jun 24, 2022

…n dependencies

Resolves: python-poetry/poetry#5902 and partially python-poetry/poetry#2415

  • [n.a.] Added tests for changed code.
  • [n.a.] Updated documentation for changed code.

An alternative solution to python-poetry/poetry#5902 as proposed in python-poetry/poetry#5903.

Currently poetry re-downloads direct origin packages multiple times during locking because the deferred cache used to store downloaded packages is indexed using a dependency object with an explicit constraint while the lookup is done with a dependency object with an unbounded constraint which do not test equal.

This PR solves that issue by changing the __eq__ equality check for direct origin dependencies to not consider the constraint. This should pose no problems since direct origin dependencies pointing to the same origin implicitly have the same constraint.

Should I add a test for this or do we consider this an implementation detail for the sake of our current caching mechanism?

@Jinior Jinior changed the title Do not consider constrants when checking for equality of direct origi… Do not consider constraints when checking for equality of direct origi… Jun 24, 2022
@Jinior
Copy link
Contributor Author

Jinior commented Jun 26, 2022

Can somebody re-run the pipeline on this PR? I suspect it failed due to #406

@dimbleby
Copy link
Contributor

@Jinior simply re-running the tests won't help, because your branch doesn't have the fix for #406 in it.

You should rebase on the latest main code which will pick up the fix; and then push which will rerun the tests

@sonarcloud
Copy link

sonarcloud bot commented Jul 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@radoering radoering merged commit d9ea915 into python-poetry:main Jul 3, 2022
@radoering radoering mentioned this pull request Jul 9, 2022
@Jinior Jinior deleted the fix-dependency-eq branch July 13, 2022 15:19
bostonrwalker pushed a commit to bostonrwalker/poetry-core that referenced this pull request Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poetry repeadetly re-downloads url dependencies during dependency solving
3 participants