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

In version-constraints prefix-matching (with .*) is not respected after a pre-release version #6774

Closed
4 tasks done
itsdani opened this issue Oct 11, 2022 · 4 comments
Closed
4 tasks done
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@itsdani
Copy link

itsdani commented Oct 11, 2022

  • Poetry version: 1.2.2

  • Python version: 3.8.12

  • OS version and name: Ubuntu 20.04

  • pyproject.toml: https://gist.github.com/itsdani/56f0cf43397bc32daefb34622efb95f5

  • 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

We have a package (lib-one) which has the following versions:

  • 1.0.6a1
  • 1.0.6a1.post1.dev20221011110403
  • 1.0.6a1.post2.dev20221011110301
  • 1.0.7

We would like to install the latest post-release for 1.0.6a1 i.e. 1.0.6a1.post2.dev20221011110301 with a version constraint ==1.0.6a1.*. There is no lock-file yet. After poetry install an unexpected version is installed.

Expected behavior

We expect the 1.0.6a1.post1.dev20221011110403 to be installed

Actual behavior

The 1.0.6a1 version is installed

The relevant output from poetry install -vvv:

Updating dependencies
Resolving dependencies...
   1: fact: lib-two is 1.0.0
   1: derived: lib-two
   1: fact: lib-two depends on lib-one (==1.0.6a1.*)
   1: selecting lib-two (1.0.0)
   1: derived: lib-one (==1.0.6a1)
   1: selecting lib-one (1.0.6a1)
   1: Version solving took 0.304 seconds.
   1: Tried 1 solutions.

Workaround

In this case the version constraint ">=1.0.6a1, <1.0.6a2" basically does what we want, but based on the documentation and PEP 440, the ==1.0.6a1.* constraint should result in the same package version in this scenario.

This worked as expected in poetry 1.1.15, but doesn't work since 1.2.0

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

PTAL @radoering @dimbleby

@neersighted neersighted added area/solver Related to the dependency resolver and removed status/triage This issue needs to be triaged labels Oct 11, 2022
@radoering
Copy link
Member

Might be fixed by python-poetry/poetry-core#402. Unfortunately, that one got stuck a bit.

@dimbleby
Copy link
Contributor

python-poetry/poetry-core#402 is now merged and released and indeed fixes this, this can be closed

Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants