Skip to content

[BUG] Wheel naming is not following PEP 491 convention #3777

@bastienqb

Description

@bastienqb

setuptools version

setuptools==66.0.0

Python version

python 3.8

OS

macOS

Additional environment information

No response

Description

I am building a wheel for a python package using setuptools and it seems that the naming of my wheel file is not respecting the PEP 491 convention.

For external reasons, I need to name my package with the structure {namespace}.{package-name}. If I follow the convention, I would expect that my wheel file is named: namespace_package_name-0.1.0-py2.py3-none-any.whl.

However, I get this name for my wheel: namespace.package_name-0.1.0-py2.py3-none-any.whl, which is not respecting the convention.

Expected behavior

I expect the "." in the package name to be replaced with a "_" in the wheel name.

How to Reproduce

  1. create a hello_world package structure:
    hello_world
    |- my_package
    |    |- __init__.py
    |    |- hello_world.py
    |- pyproject.toml
    |- setup.cfg
    
  2. in setup.cfg, write:
    [metadata]
    name = namespace.my-package
    version = 0.1.0
    
    [options]
    zip_safe = False
    include_package_data = True
    packages = find:
    
  3. in project.toml, write:
    [build-system]
    requires = ["setuptools==66.0.0", "wheel"]
    build-backend = "setuptools.build_meta"
    
  4. run pipx run build at the root of your hello_world package
  5. inspect the dist directory which was created

Output

in the dist folder, you find:

  • namespace.my_package-0.1.0-py3-none-any.whl

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionIssues where the implementation still needs to be discussed.Needs InvestigationIssues which are likely in scope but need investigation to figure out the causebughelp wanted

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions