Skip to content

Commit a95eecd

Browse files
authored
ci: fix clippy jobs only running Python 3.7 checks (PyO3#5090)
* ci: fix clippy jobs only running Python 3.7 checks * pass correct config file for 3.13t
1 parent d50ec3e commit a95eecd

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

noxfile.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -877,34 +877,38 @@ def _get_rust_default_target() -> str:
877877

878878

879879
@lru_cache()
880-
def _get_feature_sets() -> Generator[Tuple[str, ...], None, None]:
880+
def _get_feature_sets() -> Tuple[str, ...]:
881881
"""Returns feature sets to use for clippy job"""
882-
cargo_target = os.getenv("CARGO_BUILD_TARGET", "")
883-
884-
yield from (
885-
("--no-default-features",),
886-
(
887-
"--no-default-features",
888-
"--features=abi3",
889-
),
890-
)
891882

892-
features = "full"
883+
def _generate() -> Generator[Tuple[str, ...], None, None]:
884+
cargo_target = os.getenv("CARGO_BUILD_TARGET", "")
893885

894-
if "wasm32-wasip1" not in cargo_target:
895-
# multiple-pymethods not supported on wasm
896-
features += ",multiple-pymethods"
886+
yield from (
887+
("--no-default-features",),
888+
(
889+
"--no-default-features",
890+
"--features=abi3",
891+
),
892+
)
897893

898-
if get_rust_version()[:2] >= (1, 67):
899-
# time needs MSRC 1.67+
900-
features += ",time"
894+
features = "full"
901895

902-
if get_rust_version()[:2] >= (1, 70):
903-
# jiff needs MSRC 1.70+
904-
features += ",jiff-02"
896+
if "wasm32-wasip1" not in cargo_target:
897+
# multiple-pymethods not supported on wasm
898+
features += ",multiple-pymethods"
899+
900+
if get_rust_version()[:2] >= (1, 67):
901+
# time needs MSRC 1.67+
902+
features += ",time"
905903

906-
yield (f"--features={features}",)
907-
yield (f"--features=abi3,{features}",)
904+
if get_rust_version()[:2] >= (1, 70):
905+
# jiff needs MSRC 1.70+
906+
features += ",jiff-02"
907+
908+
yield (f"--features={features}",)
909+
yield (f"--features=abi3,{features}",)
910+
911+
return tuple(_generate())
908912

909913

910914
_RELEASE_LINE_START = "release: "
@@ -1029,6 +1033,11 @@ def set(
10291033
self, implementation: str, version: str, build_flags: Iterable[str] = ()
10301034
) -> None:
10311035
"""Set the contents of this config file to the given implementation and version."""
1036+
if version.endswith("t"):
1037+
# Free threaded versions pass the support in config file through a flag
1038+
version = version[:-1]
1039+
build_flags = (*build_flags, "Py_GIL_DISABLED")
1040+
10321041
self._config_file.seek(0)
10331042
self._config_file.truncate(0)
10341043
self._config_file.write(

0 commit comments

Comments
 (0)