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

1.1.0b3: Regression in handling python version constraints when running add/update #2950

Closed
abn opened this issue Sep 23, 2020 · 2 comments · Fixed by python-poetry/poetry-core#84, python-poetry/poetry-core#86 or #2968
Assignees
Labels
kind/bug Something isn't working as expected status/waiting-on-core Requires changes to poetry-core first
Milestone

Comments

@abn
Copy link
Member

abn commented Sep 23, 2020

The 1.1.0b3 release introduces a regression in add/update command handling of a dependency's python version constriants.

For example when attempting to update poetry's own dependencies, this happens.

   SolverProblemError

  The current project's Python requirement (>=2.7,<2.8 || >=3.5,<4.0) is not compatible with some of the required packages Python requirement:
    - pre-commit requires Python >=3.6.1, so it will not be satisfied for Python >=2.7,<2.8 || >=3.5,<3.6.1
    - pre-commit requires Python >=3.6.1, so it will not be satisfied for Python >=2.7,<2.8 || >=3.5,<3.6.1
    - pre-commit requires Python >=3.6.1, so it will not be satisfied for Python >=2.7,<2.8 || >=3.5,<3.6.1
  
  Because no versions of pre-commit match >2.6,<2.7.0 || >2.7.0,<2.7.1 || >2.7.1,<3.0
   and pre-commit (2.6.0) requires Python >=3.6.1, pre-commit is forbidden.
  And because pre-commit (2.7.0) requires Python >=3.6.1, pre-commit is forbidden.
  So, because pre-commit (2.7.1) requires Python >=3.6.1
   and poetry depends on pre-commit (^2.6), version solving failed.

  at poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For pre-commit, a possible solution would be to set the `python` property to ">=3.6.1,<4.0"
    For pre-commit, a possible solution would be to set the `python` property to ">=3.6.1,<4.0"
    For pre-commit, a possible solution would be to set the `python` property to ">=3.6.1,<4.0"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

The specification for pre-commit is correct and as expected.

pre-commit = { version = "^2.6", python = "^3.6.1" }

Re-adding with exact constraints fail as well, but with futures (python 2 only dependency).

$ poetry add pre-commit@latest --python='>=3.6.1,<4.0'
Using version ^2.7.1 for pre-commit

Updating dependencies
Resolving dependencies... (0.1s)

  SolverProblemError

  The current project's Python requirement (>=2.7,<2.8 || >=3.5,<4.0) is not compatible with some of the required packages Python requirement:
    - futures requires Python >=2.6, <3, so it will not be satisfied for Python >=3.5,<4.0
  
  Because futures (3.3.0) requires Python >=2.6, <3
   and no versions of futures match >3.3.0,<4.0.0, futures is forbidden.
  So, because poetry depends on futures (^3.3.0), version solving failed.

  at poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For futures, a possible solution would be to set the `python` property to ">=2.7,<2.8"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
@abn
Copy link
Member Author

abn commented Sep 25, 2020

Re-opening to wait for next core release.

Copy link

github-actions bot commented Mar 3, 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 3, 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 status/waiting-on-core Requires changes to poetry-core first
Projects
None yet
2 participants