Skip to content

Commit

Permalink
Merge https://github.com/pypa/distutils into distutils-91f75bb98
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 23, 2025
2 parents d31c5b9 + 91f75bb commit 214135e
Show file tree
Hide file tree
Showing 19 changed files with 2,993 additions and 2,899 deletions.
605 changes: 2 additions & 603 deletions setuptools/_distutils/_msvccompiler.py

Large diffs are not rendered by default.

1,274 changes: 16 additions & 1,258 deletions setuptools/_distutils/ccompiler.py

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion setuptools/_distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def get_export_symbols(self, ext):
provided, "PyInit_" + module_name. Only relevant on Windows, where
the .pyd file (DLL) must export the module "PyInit_" function.
"""
name = ext.name.split('.')[-1]
name = self._get_module_name_for_symbol(ext)
try:
# Unicode module name support as defined in PEP-489
# https://peps.python.org/pep-0489/#export-hook-name
Expand All @@ -744,6 +744,15 @@ def get_export_symbols(self, ext):
ext.export_symbols.append(initfunc_name)
return ext.export_symbols

def _get_module_name_for_symbol(self, ext):
# Package name should be used for `__init__` modules
# https://github.com/python/cpython/issues/80074
# https://github.com/pypa/setuptools/issues/4826
parts = ext.name.split(".")
if parts[-1] == "__init__" and len(parts) >= 2:
return parts[-2]
return parts[-1]

def get_libraries(self, ext): # noqa: C901
"""Return the list of libraries to link against when building a
shared extension. On most platforms, this is just 'ext.libraries';
Expand Down
Loading

0 comments on commit 214135e

Please sign in to comment.