Skip to content

Commit 1ca55e4

Browse files
committed
Do not import macosx_libfile from pypa/wheel
1 parent 2197987 commit 1ca55e4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

setuptools/command/_macosx_libfile.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
2-
IMPORTANT: DO NOT IMPORT THIS MODULE DIRECTLY.
2+
IMPORTANT: THIS FILE IS NOW IN "MAINTENANCE MODE".
3+
DO NOT IMPORT THIS MODULE DIRECTLY.
34
THIS IS ONLY KEPT IN PLACE FOR BACKWARDS COMPATIBILITY WITH
45
setuptools.command.bdist_wheel.
56
@@ -289,7 +290,7 @@ def read_data(struct_class: type[ctypes.Structure], lib_file: BufferedIOBase):
289290
return struct_class.from_buffer_copy(lib_file.read(ctypes.sizeof(struct_class)))
290291

291292

292-
def extract_macosx_min_system_version(path_to_lib: str):
293+
def extract_macosx_min_system_version(path_to_lib: str): # noqa: C901
293294
with open(path_to_lib, "rb") as lib_file:
294295
BaseClass, magic_number = get_base_class_and_magic_number(lib_file, 0)
295296
if magic_number not in [FAT_MAGIC, FAT_MAGIC_64, MH_MAGIC, MH_MAGIC_64]:
@@ -404,7 +405,7 @@ def parse_version(version: int) -> tuple[int, int, int]:
404405
return x, y, z
405406

406407

407-
def calculate_macosx_platform_tag(archive_root: StrPath, platform_tag: str) -> str:
408+
def calculate_macosx_platform_tag(archive_root: StrPath, platform_tag: str) -> str: # noqa: C901
408409
"""
409410
Calculate proper macosx platform tag basing on files which are included to wheel
410411

setuptools/command/bdist_wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_platform(archive_root: str | None) -> str:
6060
"""Return our platform name 'win32', 'linux_x86_64'"""
6161
result = sysconfig.get_platform()
6262
if result.startswith("macosx") and archive_root is not None: # pragma: no cover
63-
from wheel.macosx_libfile import calculate_macosx_platform_tag
63+
from ._macosx_libfile import calculate_macosx_platform_tag
6464

6565
result = calculate_macosx_platform_tag(archive_root, result)
6666
elif _is_32bit_interpreter():

0 commit comments

Comments
 (0)