3535DEFAULT_PYTHON_VERSION = "3.14"
3636
3737UNIT_TEST_PYTHON_VERSIONS : List [str ] = [
38- "3.8" ,
3938 "3.9" ,
4039 "3.10" ,
4140 "3.11" ,
4443 "3.14" ,
4544]
4645
47- ALL_PYTHON = list (UNIT_TEST_PYTHON_VERSIONS )
48- ALL_PYTHON .extend (["3.7" ])
49-
5046UNIT_TEST_STANDARD_DEPENDENCIES = [
5147 "mock" ,
5248 "asyncmock" ,
@@ -225,36 +221,15 @@ def install_unittest_dependencies(session, *constraints):
225221 session .install ("-e" , "." , * constraints )
226222
227223
228- @nox .session (python = ALL_PYTHON )
229- @nox .parametrize (
230- "protobuf_implementation" ,
231- ["python" , "upb" , "cpp" ],
232- )
233- def unit (session , protobuf_implementation ):
224+ @nox .session (python = UNIT_TEST_PYTHON_VERSIONS )
225+ def unit (session ):
234226 # Install all test dependencies, then install this package in-place.
235227
236- if session .python in ("3.7" ,):
237- session .skip ("Python 3.7 is no longer supported" )
238-
239- if protobuf_implementation == "cpp" and session .python in (
240- "3.11" ,
241- "3.12" ,
242- "3.13" ,
243- "3.14" ,
244- ):
245- session .skip ("cpp implementation is not supported in python 3.11+" )
246-
247228 constraints_path = str (
248229 CURRENT_DIRECTORY / "testing" / f"constraints-{ session .python } .txt"
249230 )
250231 install_unittest_dependencies (session , "-c" , constraints_path )
251232
252- # TODO(https://github.com/googleapis/synthtool/issues/1976):
253- # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
254- # The 'cpp' implementation requires Protobuf<4.
255- if protobuf_implementation == "cpp" :
256- session .install ("protobuf<4" )
257-
258233 # Run py.test against the unit tests.
259234 session .run (
260235 "py.test" ,
@@ -268,9 +243,6 @@ def unit(session, protobuf_implementation):
268243 "--cov-fail-under=0" ,
269244 os .path .join ("tests" , "unit" ),
270245 * session .posargs ,
271- env = {
272- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
273- },
274246 )
275247
276248
@@ -444,21 +416,9 @@ def docfx(session):
444416
445417
446418@nox .session (python = DEFAULT_PYTHON_VERSION )
447- @nox .parametrize (
448- "protobuf_implementation" ,
449- ["python" , "upb" , "cpp" ],
450- )
451- def prerelease_deps (session , protobuf_implementation ):
419+ def prerelease_deps (session ):
452420 """Run all tests with prerelease versions of dependencies installed."""
453421
454- if protobuf_implementation == "cpp" and session .python in (
455- "3.11" ,
456- "3.12" ,
457- "3.13" ,
458- "3.14" ,
459- ):
460- session .skip ("cpp implementation is not supported in python 3.11+" )
461-
462422 # Install all dependencies
463423 session .install ("-e" , ".[all, tests, tracing]" )
464424 unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -536,9 +496,6 @@ def prerelease_deps(session, protobuf_implementation):
536496 session .run (
537497 "py.test" ,
538498 "tests/unit" ,
539- env = {
540- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
541- },
542499 )
543500
544501 system_test_path = os .path .join ("tests" , "system.py" )
@@ -558,9 +515,6 @@ def prerelease_deps(session, protobuf_implementation):
558515 f"--junitxml=system_{ session .python } _sponge_log.xml" ,
559516 system_test_path ,
560517 * session .posargs ,
561- env = {
562- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
563- },
564518 )
565519 if os .path .exists (system_test_folder_path ):
566520 session .run (
@@ -569,9 +523,6 @@ def prerelease_deps(session, protobuf_implementation):
569523 f"--junitxml=system_{ session .python } _sponge_log.xml" ,
570524 system_test_folder_path ,
571525 * session .posargs ,
572- env = {
573- "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION" : protobuf_implementation ,
574- },
575526 )
576527
577528
0 commit comments