File tree Expand file tree Collapse file tree
packages/gapic-generator/gapic Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[mypy]
2- python_version = 3.14
32namespace_packages = True
43ignore_missing_imports = False
54
Original file line number Diff line number Diff line change 33{% block content %}
44
55import os
6+ import pathlib
67
78import nox # type: ignore
89
910
11+ CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
12+ # Path to the centralized mypy configuration file at the repository root.
13+ MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
14+
15+
1016# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
1117# Add tests for Python 3.15 alpha1
1218# https://peps.python.org/pep-0790/
@@ -44,7 +50,7 @@ def mypy(session):
4450 session.install('.')
4551 session.run(
4652 'mypy',
47- "--config-file=../../mypy.ini ",
53+ f "--config-file={MYPY_CONFIG_FILE} ",
4854 {% if api .naming .module_namespace %}
4955 '{{ api.naming.module_namespace[0] }}',
5056 {% else %}
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ DEFAULT_PYTHON_VERSION = "3.14"
4040PREVIEW_PYTHON_VERSION = "3.14"
4141
4242CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
43+ # Path to the centralized mypy configuration file at the repository root.
44+ MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
4345
4446if (CURRENT_DIRECTORY / "testing").exists():
4547 LOWER_BOUND_CONSTRAINTS_FILE = (
@@ -101,7 +103,7 @@ def mypy(session):
101103 session.install(" . " )
102104 session.run(
103105 " mypy " ,
104- " --config-file =../../mypy.ini " ,
106+ f " --config-file ={MYPY_CONFIG_FILE} " ,
105107 " -p " ,
106108 {% if api.naming.module_namespace %}
107109 " {{ api.naming.module_namespace[0] }} " ,
You can’t perform that action at this time.
0 commit comments