Skip to content

[BUG] Incompatible bdist_wheel.universal and requires-python behaviors build misleading "py2" package #4613

@dbarnett

Description

@dbarnett

setuptools version

setuptools==68.1.2

Python version

Python 3.12.3

OS

Ubuntu Linux 24.04

Additional environment information

No response

Description

Packages built with bdist_wheel.universal seem to promote py2 usage even when combined with project.requires-python = ">= 3". Could that be changed to stop implying py2 compatibility and/or have better docs & messaging to clarify how it works?

The option name bdist_wheel.universal sounds pretty generic for something that triggers such arcane behavior, and it's not super clear from docs whether universal is supposed to have any meaning anymore after py2 EOL.

Note: Originally reported at pypa/build#806, was told to report here instead.

Expected behavior

When I build packages that explicitly don't support python 2, I'd like to avoid PyPI saying simultaneously that it's a "Python 2" distribution and that it requires Python 3: pypi org_project_gcalcli_

I think that entails removing the "py2" from the wheel filename.

How to Reproduce

  1. Clone https://github.com/insanum/gcalcli/tree/4dabc51664aad65db282668769e85db83a057bb5
  2. Run python -m build
  3. Look at the output filenames and/or a preview of the published project on TestPyPI

Output

From python -m build:

Successfully built gcalcli-4.4.0.tar.gz and gcalcli-4.4.0-py2.py3-none-any.whl

From published https://pypi.org/project/gcalcli/4.4.0/#files:

Built Distribution
gcalcli-4.4.0-py2.py3-none-any.whl (43.2 kB see hashes))
Uploaded about 8 hours ago (Python 2) (Python 3)
Requires: Python >=3.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions