Skip to content

poetry incorrectly identifies python version requirement #5077

@chaosct

Description

@chaosct
  • I am on the latest Poetry version.
  • 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: Raspbian GNU/Linux 10 (buster)
  • Poetry version: 1.1.12
  • Link of a Gist with the contents of your pyproject.toml file: pyproject.toml

Issue

poetry run does not honor poetry env:

$ pyenv local
3.9.10
$ python --version
Python 3.9.10
$ poetry env use python3.9
Using virtualenv: /home/pi/.cache/pypoetry/virtualenvs/ppx-node-production-tool-8PNkRAxl-py3.9
$ poetry run python --version
Python 3.7.3

This causes that some parts of a poetry install command use the 3.9 version of python but others not:

$ poetry install
Updating dependencies
Resolving dependencies... (10.9s)

Writing lock file

  SolverProblemError

  The current project's Python requirement (3.7.3) is not compatible with some of the required packages Python requirement:
    - ppx-remote requires Python >=3.9,<4.0, so it will not be satisfied for Python 3.7.3

  Because ppx-remote (0.3.0) requires Python >=3.9,<4.0
   and no versions of ppx-remote match !=0.3.0, ppx-remote is forbidden.
  So, because ppx-node-production-tool depends on ppx-remote (*), version solving failed.
...

As you can see, the python version requirement is not correctly identified. pyproject.toml specifies python = "^3.9"

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions