mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-93939: Build C extensions without setup.py (GH-94474)
Combines GH-93940, GH-94452, and GH-94433
This commit is contained in:
parent
b03a9e8c8a
commit
81dca70d70
14 changed files with 89 additions and 1506 deletions
|
|
@ -130,10 +130,11 @@ class ModuleChecker:
|
|||
pybuilddir_txt = "pybuilddir.txt"
|
||||
|
||||
setup_files = (
|
||||
SRC_DIR / "Modules/Setup",
|
||||
# see end of configure.ac
|
||||
"Modules/Setup.local",
|
||||
"Modules/Setup.bootstrap",
|
||||
"Modules/Setup.stdlib",
|
||||
"Modules/Setup.bootstrap",
|
||||
SRC_DIR / "Modules/Setup",
|
||||
)
|
||||
|
||||
def __init__(self, cross_compiling: bool = False, strict: bool = False):
|
||||
|
|
@ -308,12 +309,6 @@ class ModuleChecker:
|
|||
MODBUILT_NAMES: modules in *static* block
|
||||
MODSHARED_NAMES: modules in *shared* block
|
||||
MODDISABLED_NAMES: modules in *disabled* block
|
||||
|
||||
Modules built by setup.py addext() have a MODULE_{modname}_STATE entry,
|
||||
but are not listed in MODSHARED_NAMES.
|
||||
|
||||
Modules built by old-style setup.py add() have neither a MODULE_{modname}
|
||||
entry nor an entry in MODSHARED_NAMES.
|
||||
"""
|
||||
moddisabled = set(sysconfig.get_config_var("MODDISABLED_NAMES").split())
|
||||
if self.cross_compiling:
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ from check_extension_modules import ModuleChecker
|
|||
|
||||
SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
||||
STDLIB_PATH = os.path.join(SRC_DIR, 'Lib')
|
||||
SETUP_PY = os.path.join(SRC_DIR, 'setup.py')
|
||||
|
||||
IGNORE = {
|
||||
'__init__',
|
||||
|
|
@ -64,15 +63,6 @@ def list_packages(names):
|
|||
names.add(name)
|
||||
|
||||
|
||||
# Extension modules built by setup.py
|
||||
def list_setup_extensions(names):
|
||||
cmd = [sys.executable, SETUP_PY, "-q", "build", "--list-module-names"]
|
||||
output = subprocess.check_output(cmd)
|
||||
output = output.decode("utf8")
|
||||
extensions = output.splitlines()
|
||||
names |= set(extensions)
|
||||
|
||||
|
||||
# Built-in and extension modules built by Modules/Setup*
|
||||
# includes Windows and macOS extensions.
|
||||
def list_modules_setup_extensions(names):
|
||||
|
|
@ -103,7 +93,6 @@ def list_frozen(names):
|
|||
def list_modules():
|
||||
names = set(sys.builtin_module_names)
|
||||
list_modules_setup_extensions(names)
|
||||
list_setup_extensions(names)
|
||||
list_packages(names)
|
||||
list_python_modules(names)
|
||||
list_frozen(names)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue