python-poetry / python-poetry/poetry

Distribution wheel filename can use full `python` version tag

Open
#5,950 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

If a pyproject.toml has python dependency:

[tool.poetry.dependencies]
python = "^3.9.0"

Currently, the resulting wheel will have the filename <name>-<version>-py3-none-any.whl. Similarly, inside the wheel, the <name>-<version>.dist-info directory WHEEL file has the contents:

Wheel-Version: 1.0
Generator: poetry 1.0.8
Root-Is-Purelib: true
Tag: py3-none-any

Only the METADATA file contains the correct range of supported python versions Requires-Python: >=3.9.0,<4.0.0

The under specified wheel filename can lead to some undesirable behavior is some situations:

  • If a user attempts to install the wheel from an unsupported python version (like python@3,7), pip doesn't know that the wheel is incompatible until it downloads the source and attempts to install it.
  • While pip is attempting to install the incompatible wheel, third party dependencies may also be triggered to begin downloading even though the install will ultimately fail. This leads to unnecessary bandwidth being used by the host of those dependencies like Pypi.

Desired Behavior

Use the full python version to tag the wheel filename (<name>-<version>-py39-none-any.whl in this example), and mirror the tag in the WHEEL file as well.

This will allow pip install <name> to fail immediately when installing from an unsupported python version without downloading the source or triggering third party dependencies to also start downloading. This will save time as well as bandwidth for users and hosts.

$ python@3.7 -m pip install dist/<name>-<version>-py39-none-any.whl
ERROR: <name>-<version>-py39-none-any.whl is not a supported wheel on this platform.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the wheel-building entry point and any tests covering generated wheel filenames or WHEEL metadata. Trace how the Python dependency constraint is converted into the current py3 tag. Done means a ^3.9.0 constraint produces matching py39-none-any tags in both the filename and WHEEL file, while preserving the Requires-Python range.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.