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