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

Dependency with version "^0" does not work in 1.2.0a1 #4153

Closed
3 tasks done
joshorr opened this issue Jun 7, 2021 · 2 comments · Fixed by python-poetry/poetry-core#201
Closed
3 tasks done

Dependency with version "^0" does not work in 1.2.0a1 #4153

joshorr opened this issue Jun 7, 2021 · 2 comments · Fixed by python-poetry/poetry-core#201
Labels
kind/bug Something isn't working as expected

Comments

@joshorr
Copy link

joshorr commented Jun 7, 2021

  • I am on the 1.2.0a1 alpha Poetry version (1.2.0a1)

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: MacOS 11.4; BigSur

  • Poetry version: 1.2.0a1

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/joshorr/d25b9edb7e20d00dab565dce771b69dd

Issue

When you have a dependency with version set to "^0", it errors out while executing poetry update. Currently released 1.1.6 version works fine with this. It's the new 1.2.0a1 that has the problem.

According to docs at (https://python-poetry.org/docs/versions/), you should be able to do this. It's equivalent to doing >=0.0.0 <1.0.0. If you do >=0.0.0 <1.0.0, that works for 1.2.0a1, so that's the workaround at the moment.

You can test it by creating a new project via:

poetry new

And then adding this dependency to the pyproject.toml file:

pendulum = "^0"

Then, finally doing an update:

poetry update

If you do these steps with version 1.1.6, it works fine. But version 1.2.0a1 will error out with this output (-vvv):

https://gist.github.com/joshorr/9093c552515451f9e1037adff54a990a

@joshorr joshorr added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 7, 2021
@apollo13
Copy link
Contributor

This is explicitly tested in
https://github.com/python-poetry/poetry-core/blob/ad33bc2f92be03dc5b31a666664903c439fb1173/tests/semver/test_helpers.py#L194
but I agree that this does go against the documentation. It seems to have been changed by @abn via
python-poetry/poetry-core@748157e#diff-097699e72f731cb04c9485e35af6cf0b1f8201e8ebb39bd26a0be8e4b5dfea19L85-R194

I found this article https://nodesource.com/blog/semver-tilde-and-caret/ which links to gems like this https://twitter.com/jo_liss/status/494986913124990977 -- but either way, the docs or the code should be fixed. @abn can you shed any light on the reason why you wrote the test like you did?

Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants