Skip to content

Commit 26c0399

Browse files
committed
Add _contextvars as config-c-only
1 parent 99f9af9 commit 26c0399

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

cpython-unix/extension-modules.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ _collections:
8888
_contextvars:
8989
sources:
9090
- _contextvarsmodule.c
91+
config-c-only-conditional:
92+
- config-c-only: true
93+
minimum-python-version: "3.14"
9194

9295
_crypt:
9396
maximum-python-version: "3.12"
@@ -441,7 +444,7 @@ _random:
441444
_remote_debugging:
442445
minimum-python-version: "3.14"
443446
sources:
444-
- remote_debugging.c
447+
- _remote_debugging_module.c
445448

446449
_scproxy:
447450
# _scproxy is Apple OS only.

pythonbuild/cpython.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@
1616
"properties": {
1717
"build-mode": {"type": "string"},
1818
"config-c-only": {"type": "boolean"},
19+
"config-c-only-conditional": {
20+
"type": "array",
21+
"items": {
22+
"type": "object",
23+
"properties": {
24+
"config-c-only": {"type": "boolean"},
25+
"minimum-python-version": {"type": "string"},
26+
"maximum-python-version": {"type": "string"},
27+
},
28+
"additionalProperties": False,
29+
"required": ["config-c-only"],
30+
},
31+
},
1932
"defines": {"type": "array", "items": {"type": "string"}},
2033
"defines-conditional": {
2134
"type": "array",
@@ -286,6 +299,18 @@ def derive_setup_local(
286299
if info.get("config-c-only"):
287300
config_c_only_wanted.add(name)
288301

302+
for entry in info.get("config-c-only-conditional", []):
303+
python_min_match_setup = meets_python_minimum_version(
304+
python_version, entry.get("minimum-python-version", "1.0")
305+
)
306+
python_max_match_setup = meets_python_maximum_version(
307+
python_version, entry.get("maximum-python-version", "100.0")
308+
)
309+
if entry.get("config-c-only", False) and (
310+
python_min_match_setup and python_max_match_setup
311+
):
312+
config_c_only_wanted.add(name)
313+
289314
# Parse more files in the distribution for their metadata.
290315

291316
with tarfile.open(str(cpython_source_archive)) as tf:

0 commit comments

Comments
 (0)