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

Fix the parsing of wildcards dependency constraints #186

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

sdispater
Copy link
Member

Resolves: python-poetry/poetry#4176

  • Added tests for changed code.
  • Updated documentation for changed code.

@sdispater sdispater added the Bug Something isn't working label Aug 16, 2021
@sdispater sdispater merged commit 4e1f2ab into master Aug 17, 2021
@sdispater sdispater deleted the fix-requirements-wildcard-constraints branch August 17, 2021 08:13
@bentheiii
Copy link

I think this fix is incorrect, as name < 3.* should accept version3.6.0, I think name < 3.* should be normalized to name < 4

@finswimmer
Copy link
Member

Hello @bentheiii,

name < 3.* could be read as "any version smaller 3.anything". So it's < 3.

I think this fix is incorrect.

Please don't call it a "fix" (even it's in the title ;) ). It's a (temporary) workaround, to mimic pip's wrong behavior of allowing this kind of invalid PEP 440 constraint. Otherwise to many packages cannot be installed anymore. (See also: https://discuss.python.org/t/pep-440-wildcard-usage-in-comparison-clause/10045)

@bentheiii
Copy link

It is indeed a pretty unclear whether name (?) X.* should resolve to "version chosen must match the constraint for any X.*" or "version chosen must match the constraint for all X.*". But since name > 3.* resolves to name > 3, poetry obviously goes with the former. Therefore, name < 3.* has to be less than any version 3.* , it has to only be less than an arbitrarily high *, normalizing to name < 4 (just like how name > 3.* must be higher than an arbitrarily low *, normalizing to name > 3).

@furlongm
Copy link

Would it be possible to make a prerelease that contains this fix/workaround? We are trying to use newer features of poetry but this issue is holding us back.

@edgarrmondragon
Copy link
Contributor

@furlongm is there a reason not to install from master in the meantime if the feature you need is there?

@furlongm
Copy link

@furlongm is there a reason not to install from master in the meantime if the feature you need is there?

Mostly a desire to pin the poetry dependencies at a specific version so it's not a moving target - also don't always have access to github but do have a pypi mirror, so released versions are a lot more accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore period for version parse
6 participants