File tree Expand file tree Collapse file tree
tests/integration/goldens Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ import pathlib
88import nox # type: ignore
99
1010CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
11- MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
11+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
12+ MYPY_CONFIG_FILE = next(
13+ (str(p / "mypy.ini") for p in CURRENT_DIRECTORY.parents if (p / "mypy.ini").exists()),
14+ str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
15+ )
1216
1317
1418# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
Original file line number Diff line number Diff line change @@ -41,7 +41,11 @@ PREVIEW_PYTHON_VERSION = "3.14"
4141
4242CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4343# Path to the centralized mypy configuration file at the repository root.
44- MYPY_CONFIG_FILE = str(CURRENT_DIRECTORY.parent.parent / "mypy.ini")
44+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
45+ MYPY_CONFIG_FILE = next(
46+ (str(p / "mypy.ini") for p in CURRENT_DIRECTORY.parents if (p / "mypy.ini").exists()),
47+ str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
48+ )
4549
4650LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
4751PACKAGE_NAME = "{{ api.naming.warehouse_package_name }}"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-asset"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-iam-credentials"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-eventarc"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-logging"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-logging"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-redis"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-redis"
Original file line number Diff line number Diff line change 4848
4949CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5050# Path to the centralized mypy configuration file at the repository root.
51- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
51+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
52+ MYPY_CONFIG_FILE = next (
53+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
54+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
55+ )
5256
5357LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
5458PACKAGE_NAME = "google-cloud-storagebatchoperations"
You can’t perform that action at this time.
0 commit comments