pypa / pypa/setuptools

Future of `wheel.macosx_libfile`

Open
#4,935 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

setuptools==78.1.0

Python version

Python 3.10

OS

macOS

Additional environment information

No response

Description

Getting the error below when trying uv sync. Seems to be happening due to this import.

As I see from the latest wheel release that the file, src/wheel/macosx_libfile.py, is no longer present. It was present in the previous wheel release

Error stack trace:

Traceback (most recent call last):
        File "<string>", line 11, in <module>
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 435, in build_wheel
          return _build(['bdist_wheel'])
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 315, in <module>
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command
          super().run_command(command)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 407, in run
          impl_tag, abi_tag, plat_tag = self.get_tag()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 321, in get_tag
          plat_name = get_platform(self.bdist_dir)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 63, in get_platform
          from wheel.macosx_libfile import calculate_macosx_platform_tag
      ModuleNotFoundError: No module named 'wheel.macosx_libfile'
Expected behavior

The imports should work for the latest setuptools release

How to Reproduce

Try to create a virtual environment with the latest setuptools==78.1.0.

Output
Traceback (most recent call last):
        File "<string>", line 11, in <module>
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 435, in build_wheel
          return _build(['bdist_wheel'])
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 315, in <module>
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command
          super().run_command(command)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 407, in run
          impl_tag, abi_tag, plat_tag = self.get_tag()
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 321, in get_tag
          plat_name = get_platform(self.bdist_dir)
        File "/Users/a81045729/.cache/uv/builds-v0/.tmpEp6P7H/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 63, in get_platform
          from wheel.macosx_libfile import calculate_macosx_platform_tag
      ModuleNotFoundError: No module named 'wheel.macosx_libfile'

Contributor guide

No contributing guide indexed for this repository

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

Start with setuptools/command/bdist_wheel.py, especially get_platform and its import of wheel.macosx_libfile, and compare that dependency with the current wheel release. Reproduce the failure using setuptools==78.1.0 on Python 3.10 with uv sync. Done means the latest setuptools and wheel versions build successfully without the ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.