Skip to content

Commit 396850d

Browse files
committed
Add _contextvars as config-c-only
1 parent 99f9af9 commit 396850d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cpython-unix/extension-modules.yml

Lines changed: 3 additions & 0 deletions
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"

pythonbuild/cpython.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,18 @@ def derive_setup_local(
286286
if info.get("config-c-only"):
287287
config_c_only_wanted.add(name)
288288

289+
for entry in info.get("config-c-only-conditional", []):
290+
python_min_match_setup = meets_python_minimum_version(
291+
python_version, entry.get("minimum-python-version", "1.0")
292+
)
293+
python_max_match_setup = meets_python_maximum_version(
294+
python_version, entry.get("maximum-python-version", "100.0")
295+
)
296+
if entry.get("config-c-only", False) and (
297+
python_min_match_setup and python_max_match_setup
298+
):
299+
config_c_only_wanted.add(name)
300+
289301
# Parse more files in the distribution for their metadata.
290302

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

0 commit comments

Comments
 (0)