File tree Expand file tree Collapse file tree
google-cloud-appengine-logging
google-cloud-bigquery-logging
google-cloud-source-context
google-cloud-spanner-dbapi-driver Expand file tree Collapse file tree Original file line number Diff line number Diff line change 115115
116116CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
117117# Path to the centralized mypy configuration file at the repository root.
118- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
118+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
119+ MYPY_CONFIG_FILE = next (
120+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
121+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
122+ )
119123
120124
121125# Sessions are executed in the order so putting the smaller sessions
Original file line number Diff line number Diff line change 2121
2222CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
2323# Path to the centralized mypy configuration file at the repository root.
24- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
24+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
25+ MYPY_CONFIG_FILE = next (
26+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
27+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
28+ )
2529
2630
2731CLICK_VERSION = "click"
Original file line number Diff line number Diff line change 4747
4848CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4949# Path to the centralized mypy configuration file at the repository root.
50- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
50+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
51+ MYPY_CONFIG_FILE = next (
52+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
53+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
54+ )
5155
5256
5357if (CURRENT_DIRECTORY / "testing" ).exists ():
Original file line number Diff line number Diff line change 4747
4848CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4949# Path to the centralized mypy configuration file at the repository root.
50- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
50+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
51+ MYPY_CONFIG_FILE = next (
52+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
53+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
54+ )
5155
5256
5357if (CURRENT_DIRECTORY / "testing" ).exists ():
Original file line number Diff line number Diff line change 4747
4848CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4949# Path to the centralized mypy configuration file at the repository root.
50- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
50+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
51+ MYPY_CONFIG_FILE = next (
52+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
53+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
54+ )
5155
5256
5357if (CURRENT_DIRECTORY / "testing" ).exists ():
Original file line number Diff line number Diff line change 1515from __future__ import absolute_import
1616
1717import os
18+ import pathlib
1819import re
1920import shutil
2021
3233 "3.13" ,
3334 "3.14" ,
3435]
35- CURRENT_DIRECTORY = os . path . abspath ( os . path . dirname ( __file__ ) )
36+ CURRENT_DIRECTORY = pathlib . Path ( __file__ ). parent . absolute ( )
3637# Path to the centralized mypy configuration file at the repository root.
37- MYPY_CONFIG_FILE = os .path .join (os .path .dirname (os .path .dirname (CURRENT_DIRECTORY )), "mypy.ini" )
38+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
39+ MYPY_CONFIG_FILE = next (
40+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
41+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
42+ )
3843
3944# Error if a python version is missing
4045nox .options .error_on_missing_interpreters = True
Original file line number Diff line number Diff line change 4747
4848CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4949# Path to the centralized mypy configuration file at the repository root.
50- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
50+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
51+ MYPY_CONFIG_FILE = next (
52+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
53+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
54+ )
5155
5256
5357if (CURRENT_DIRECTORY / "testing" ).exists ():
Original file line number Diff line number Diff line change 4747
4848CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4949# Path to the centralized mypy configuration file at the repository root.
50- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
50+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
51+ MYPY_CONFIG_FILE = next (
52+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
53+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
54+ )
5155
5256
5357if (CURRENT_DIRECTORY / "testing" ).exists ():
Original file line number Diff line number Diff line change 5454
5555CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
5656# Path to the centralized mypy configuration file at the repository root.
57- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
57+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
58+ MYPY_CONFIG_FILE = next (
59+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
60+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
61+ )
5862
5963
6064LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
Original file line number Diff line number Diff line change 4040BLACK_PATHS = ["test_utils" , "setup.py" ]
4141CURRENT_DIRECTORY = pathlib .Path (__file__ ).parent .absolute ()
4242# Path to the centralized mypy configuration file at the repository root.
43- MYPY_CONFIG_FILE = str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" )
43+ # Search upwards to support running nox from both monorepo packages and integration test goldens.
44+ MYPY_CONFIG_FILE = next (
45+ (str (p / "mypy.ini" ) for p in CURRENT_DIRECTORY .parents if (p / "mypy.ini" ).exists ()),
46+ str (CURRENT_DIRECTORY .parent .parent / "mypy.ini" ),
47+ )
4448
4549
4650
You can’t perform that action at this time.
0 commit comments