|
16 | 16 | "properties": {
|
17 | 17 | "build-mode": {"type": "string"},
|
18 | 18 | "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 | + }, |
19 | 32 | "defines": {"type": "array", "items": {"type": "string"}},
|
20 | 33 | "defines-conditional": {
|
21 | 34 | "type": "array",
|
@@ -286,6 +299,18 @@ def derive_setup_local(
|
286 | 299 | if info.get("config-c-only"):
|
287 | 300 | config_c_only_wanted.add(name)
|
288 | 301 |
|
| 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 | + |
289 | 314 | # Parse more files in the distribution for their metadata.
|
290 | 315 |
|
291 | 316 | with tarfile.open(str(cpython_source_archive)) as tf:
|
|
0 commit comments