Skip to content

Distribution wheel filename can use full python version tag #5950

@sullivancolin

Description

@sullivancolin
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions