3333 "docs/conf.py" ,
3434]
3535
36+ DEFAULT_PYTHON_VERSION = "3.10"
37+ # TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
38+ # Remove or restore testing for Python 3.7/3.8
39+ UNIT_TEST_PYTHON_VERSIONS = ["3.9" , "3.10" , "3.11" , "3.12" , "3.13" ]
40+
41+ # Error if a python version is missing
42+ nox .options .error_on_missing_interpreters = True
43+
44+ # pypy will be run as a github action instead of through Kokoro
45+ nox .options .sessions = [
46+ "lint" ,
47+ "blacken" ,
48+ "mypy" ,
49+ # TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
50+ # Remove or restore testing for Python 3.7/3.8
51+ "unit-3.9" ,
52+ "unit-3.10" ,
53+ "unit-3.11" ,
54+ "unit-3.12" ,
55+ "unit-3.13" ,
56+ # cover must be last to avoid error `No data to report`
57+ "cover" ,
58+ "docs" ,
59+ ]
60+
3661
37- @nox .session (python = "3.8" )
62+ @nox .session (python = DEFAULT_PYTHON_VERSION )
3863def lint (session ):
3964 session .install (
4065 "flake8" , "flake8-import-order" , "docutils" , CLICK_VERSION , BLACK_VERSION
@@ -54,7 +79,7 @@ def lint(session):
5479 )
5580
5681
57- @nox .session (python = "3.8" )
82+ @nox .session (python = DEFAULT_PYTHON_VERSION )
5883def blacken (session ):
5984 """Run black.
6085 Format code to uniform standard.
@@ -67,7 +92,7 @@ def blacken(session):
6792 session .run ("black" , * BLACK_PATHS )
6893
6994
70- @nox .session (python = "3.8" )
95+ @nox .session (python = DEFAULT_PYTHON_VERSION )
7196def mypy (session ):
7297 """Verify type hints are mypy compatible."""
7398 session .install ("-e" , "." )
@@ -84,7 +109,7 @@ def mypy(session):
84109 session .run ("mypy" , "-p" , "google" , "-p" , "tests" , "-p" , "tests_async" )
85110
86111
87- @nox .session (python = [ "3.7" , "3.8" , "3.9" , "3.10" , "3.11" , "3.12" , "3.13" ] )
112+ @nox .session (python = UNIT_TEST_PYTHON_VERSIONS )
88113def unit (session ):
89114 constraints_path = str (
90115 CURRENT_DIRECTORY / "testing" / f"constraints-{ session .python } .txt"
@@ -102,7 +127,7 @@ def unit(session):
102127 )
103128
104129
105- @nox .session (python = "3.8" )
130+ @nox .session (python = DEFAULT_PYTHON_VERSION )
106131def cover (session ):
107132 session .install ("-e" , ".[testing]" )
108133 session .run (
0 commit comments