Skip to content

Commit fcbc3cb

Browse files
committed
Do not import macosx_libfile from pypa/wheel
1 parent 545bc41 commit fcbc3cb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setuptools/command/_macosx_libfile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
"""
2+
IMPORTANT: THIS FILE IS NOW IN "MAINTENANCE MODE".
3+
DO NOT IMPORT THIS MODULE DIRECTLY.
4+
THIS IS ONLY KEPT IN PLACE FOR BACKWARDS COMPATIBILITY WITH
5+
setuptools.command.bdist_wheel.
6+
27
This module contains function to analyse dynamic library
38
headers to extract system information
49
@@ -285,7 +290,7 @@ def read_data(struct_class: type[ctypes.Structure], lib_file: BufferedIOBase):
285290
return struct_class.from_buffer_copy(lib_file.read(ctypes.sizeof(struct_class)))
286291

287292

288-
def extract_macosx_min_system_version(path_to_lib: str):
293+
def extract_macosx_min_system_version(path_to_lib: str): # noqa: C901
289294
with open(path_to_lib, "rb") as lib_file:
290295
BaseClass, magic_number = get_base_class_and_magic_number(lib_file, 0)
291296
if magic_number not in [FAT_MAGIC, FAT_MAGIC_64, MH_MAGIC, MH_MAGIC_64]:
@@ -400,7 +405,7 @@ def parse_version(version: int) -> tuple[int, int, int]:
400405
return x, y, z
401406

402407

403-
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
404409
"""
405410
Calculate proper macosx platform tag basing on files which are included to wheel
406411

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)