66
77from __future__ import annotations
88
9+ import os
10+ import sys
11+ import sysconfig
912from pathlib import Path
1013
1114import nox
1619DIR = Path (__file__ ).parent .resolve ()
1720PYPROJECT = nox .project .load_toml (DIR / "pyproject.toml" )
1821ALL_PYTHON = nox .project .python_versions (PYPROJECT )
22+ ALL_PYTHON += ["3.14t" ] # add free-threaded Python variant
1923
2024
2125@nox .session (reuse_venv = True )
@@ -44,7 +48,13 @@ def lite(session: nox.Session) -> None:
4448@nox .session (reuse_venv = True , python = ALL_PYTHON )
4549def tests (session : nox .Session ) -> None :
4650 """Run the unit and regular tests."""
47- test_deps = nox .project .dependency_groups (PYPROJECT , "test-all" )
51+ if sys .version_info [:2 ] >= (3 , 14 ) and bool (
52+ sysconfig .get_config_var ("Py_GIL_DISABLED" )
53+ ):
54+ os .environ ["PYTHON_GIL" ] = "0"
55+ test_deps = nox .project .dependency_groups (PYPROJECT , "test-all-no-gil" )
56+ else :
57+ test_deps = nox .project .dependency_groups (PYPROJECT , "test-all-gil" )
4858 session .install ("-e." , * test_deps )
4959 session .run (
5060 "pytest" ,
@@ -64,15 +74,17 @@ def coverage(session: nox.Session) -> None:
6474@nox .session (reuse_venv = True , python = ALL_PYTHON )
6575def doctests (session : nox .Session ) -> None :
6676 """Run the doctests."""
67- test_deps = nox .project .dependency_groups (PYPROJECT , "test-all" )
77+ test_deps = nox .project .dependency_groups (PYPROJECT , "test-all-gil " )
6878 session .install ("-e." , * test_deps )
6979 session .run ("pytest" , "--doctest-plus" , "src/vector/" , * session .posargs )
7080
7181
7282@nox .session (reuse_venv = True , default = False )
7383def notebooks (session : nox .Session ) -> None :
7484 """Run the notebook tests"""
75- test_deps = nox .project .dependency_groups (PYPROJECT , "test" , "test-optional" )
85+ test_deps = nox .project .dependency_groups (
86+ PYPROJECT , "test" , "test-optional" , "test-numba"
87+ )
7688 session .install ("-e." , * test_deps )
7789 session .install ("jupyter" )
7890 session .run ("pytest" , "tests/test_notebooks.py" , * session .posargs )
0 commit comments