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

Version constraint prevents installation via Poetry #89

Closed
wanderrful opened this issue Jul 9, 2020 · 1 comment · Fixed by #90
Closed

Version constraint prevents installation via Poetry #89

wanderrful opened this issue Jul 9, 2020 · 1 comment · Fixed by #90
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wanderrful
Copy link

wanderrful commented Jul 9, 2020

Describe the bug

Using Python ^3.7 or ^3.8 in your pyproject.toml file (i.e. the default values that Poetry generates) prevents adding this package via poetry add:

[SolverProblemError]
The current project's Python requirement (^3.8) is not compatible with some of the required packages Python requirement:
  - flake8-annotations requires Python >=3.6.1,<3.9

Because no versions of flake8-annotations match >2.2.0,<3.0.0
 and flake8-annotations (2.2.0) requires Python >=3.6.1,<3.9, flake8-annotations is forbidden.
So, because tool-belt depends on flake8-annotations (^2.2.0), version solving failed.

To Reproduce

  • poetry init --no-interaction to initialize a new Poetry project.
  • The python version in your pyproject.toml file will be ^3.8 or ^3.7 by default
  • poetry add flake8 (works fine)
  • poetry add flake8-annotations (throws the error described above)

Version Information

$ flake8 --version
3.8.3 (black: 0.2.0, flake8-bandit: 2.1.2, flake8-bugbear: 20.1.4, import-
order: 0.18.1, mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython
3.8.2 on Darwin
$ python -V
Python 3.8.2
@sco1 sco1 added area: dependencies bug Something isn't working labels Jul 9, 2020
@sco1 sco1 added this to the 2.2.1 milestone Jul 9, 2020
@sco1
Copy link
Owner

sco1 commented Jul 9, 2020

Thanks for the ping

Looks like this has also been asked upstream: python-poetry/poetry#2646
And answered: python-poetry/poetry#1930 (comment)

The default caret requirement of, say ^3.8, tells Poetry that your project is compatible with [3.8, 4.0), but we currently do not guarantee compatibility with >=3.9 so this is technically an incompatibility. This can be solved with a tilde requirement, ~3.8, which would describe compatibility with [3.8, 3.9).

While our dependency pinning change (see: e2f9452) is technically correct, I'm not sure it's worthwhile to insist on this if it clashes with existing project specs; in principle it's worthwhile, but it's not a hill worth dying on.

I'll try and revert the change this afternoon.

@sco1 sco1 self-assigned this Jul 9, 2020
@sco1 sco1 mentioned this issue Jul 9, 2020
@sco1 sco1 closed this as completed in #90 Jul 10, 2020
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 a pull request may close this issue.

2 participants