@@ -265,49 +265,6 @@ def unit_noextras(session):
265265 run_unit (session , install_test_extra = False )
266266
267267
268- @nox .session (python = ALL_PYTHON )
269- def mypy (session ):
270- """Run type checks with mypy."""
271- # Editable mode is not compatible with mypy when there are multiple
272- # package directories. See:
273- # https://github.com/python/mypy/issues/10564#issuecomment-851687749
274- session .install ("." )
275-
276- # Just install the dependencies' type info directly, since "mypy --install-types"
277- # might require an additional pass.
278- deps = (
279- set (
280- [
281- MYPY_VERSION ,
282- # TODO: update to latest pandas-stubs once we resolve bigframes issues.
283- "pandas-stubs<=2.2.3.241126" ,
284- "types-protobuf" ,
285- "types-python-dateutil" ,
286- "types-requests" ,
287- "types-setuptools" ,
288- "types-tabulate" ,
289- "types-PyYAML" ,
290- "polars" ,
291- "anywidget" ,
292- ]
293- )
294- | set (SYSTEM_TEST_STANDARD_DEPENDENCIES )
295- | set (UNIT_TEST_STANDARD_DEPENDENCIES )
296- )
297-
298- session .install (* deps )
299- shutil .rmtree (".mypy_cache" , ignore_errors = True )
300- session .run (
301- "mypy" ,
302- "bigframes" ,
303- os .path .join ("tests" , "system" ),
304- os .path .join ("tests" , "unit" ),
305- "--check-untyped-defs" ,
306- "--explicit-package-bases" ,
307- '--exclude="^third_party"' ,
308- )
309-
310-
311268def install_systemtest_dependencies (session , install_test_extra , * constraints ):
312269 if install_test_extra and SYSTEM_TEST_EXTRAS_BY_PYTHON :
313270 extras = SYSTEM_TEST_EXTRAS_BY_PYTHON .get (session .python , [])
@@ -979,3 +936,53 @@ def prerelease_deps(session):
979936 # TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
980937 # Add prerelease deps tests
981938 session .skip ("prerelease deps tests are not yet supported" )
939+
940+ @nox .session (python = DEFAULT_PYTHON_VERSION )
941+ def mypy (session ):
942+ """Run the type checker."""
943+ # TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
944+ # Add mypy tests previously used mypy session (below) failed to run in the monorepo
945+ session .skip ("mypy tests are not yet supported" )
946+
947+
948+ # @nox.session(python=ALL_PYTHON)
949+ # def mypy(session):
950+ # """Run type checks with mypy."""
951+ # # Editable mode is not compatible with mypy when there are multiple
952+ # # package directories. See:
953+ # # https://github.com/python/mypy/issues/10564#issuecomment-851687749
954+ # session.install(".")
955+
956+ # # Just install the dependencies' type info directly, since "mypy --install-types"
957+ # # might require an additional pass.
958+ # deps = (
959+ # set(
960+ # [
961+ # MYPY_VERSION,
962+ # # TODO: update to latest pandas-stubs once we resolve bigframes issues.
963+ # "pandas-stubs<=2.2.3.241126",
964+ # "types-protobuf",
965+ # "types-python-dateutil",
966+ # "types-requests",
967+ # "types-setuptools",
968+ # "types-tabulate",
969+ # "types-PyYAML",
970+ # "polars",
971+ # "anywidget",
972+ # ]
973+ # )
974+ # | set(SYSTEM_TEST_STANDARD_DEPENDENCIES)
975+ # | set(UNIT_TEST_STANDARD_DEPENDENCIES)
976+ # )
977+
978+ # session.install(*deps)
979+ # shutil.rmtree(".mypy_cache", ignore_errors=True)
980+ # session.run(
981+ # "mypy",
982+ # "bigframes",
983+ # os.path.join("tests", "system"),
984+ # os.path.join("tests", "unit"),
985+ # "--check-untyped-defs",
986+ # "--explicit-package-bases",
987+ # '--exclude="^third_party"',
988+ # )
0 commit comments