Skip to content

Bundle command doesn't respect Python constraint #104

@cjolowicz

Description

@cjolowicz

The bundle command doesn't respect the Python version constraint of the project. You can specify an interpreter with the --python option that isn't supported by the project.

Reproduction:

❯ poetry new .
❯ grep python pyproject.toml
python = "^3.12"
❯ /usr/bin/python3 -V
Python 3.9.6
❯ poetry bundle venv -p /usr/bin/python3 .venv
❯ .venv/bin/python -V
Python 3.9.6
❯ grep Requires-Python .venv/lib/python3.9/site-packages/repro-0.1.0.dist-info/METADATA
Requires-Python: >=3.12,<4.0

Expected behavior:

The bundle command fails with an error similar to this:

The specified Python interpreter (3.9.19) is not supported by the project (^3.12).

Actual behavior:

The bundle command creates the environment with an interpreter that doesn't satisfy the Python constraint of the project.

Environment:

  • poetry-plugin-bundle 1.3.0
  • Poetry 1.8.3
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions