|
9 | 9 | from functools import lru_cache |
10 | 10 | from glob import glob |
11 | 11 | from pathlib import Path |
12 | | -from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple |
| 12 | +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple |
13 | 13 |
|
14 | 14 | import nox |
15 | 15 | import nox.command |
@@ -655,6 +655,14 @@ def test_version_limits(session: nox.Session): |
655 | 655 | config_file.set("PyPy", "3.11") |
656 | 656 | _run_cargo(session, "check", env=env, expect_error=True) |
657 | 657 |
|
| 658 | + # Python build with GIL disabled should fail building |
| 659 | + config_file.set("CPython", "3.13", build_flags=["Py_GIL_DISABLED"]) |
| 660 | + _run_cargo(session, "check", env=env, expect_error=True) |
| 661 | + |
| 662 | + # Python build with GIL disabled should pass with env flag on |
| 663 | + env["UNSAFE_PYO3_BUILD_FREE_THREADED"] = "1" |
| 664 | + _run_cargo(session, "check", env=env) |
| 665 | + |
658 | 666 |
|
659 | 667 | @nox.session(name="check-feature-powerset", venv_backend="none") |
660 | 668 | def check_feature_powerset(session: nox.Session): |
@@ -919,14 +927,17 @@ class _ConfigFile: |
919 | 927 | def __init__(self, config_file) -> None: |
920 | 928 | self._config_file = config_file |
921 | 929 |
|
922 | | - def set(self, implementation: str, version: str) -> None: |
| 930 | + def set( |
| 931 | + self, implementation: str, version: str, build_flags: Iterable[str] = () |
| 932 | + ) -> None: |
923 | 933 | """Set the contents of this config file to the given implementation and version.""" |
924 | 934 | self._config_file.seek(0) |
925 | 935 | self._config_file.truncate(0) |
926 | 936 | self._config_file.write( |
927 | 937 | f"""\ |
928 | 938 | implementation={implementation} |
929 | 939 | version={version} |
| 940 | +build_flags={','.join(build_flags)} |
930 | 941 | suppress_build_script_link_lines=true |
931 | 942 | """ |
932 | 943 | ) |
|
0 commit comments