@@ -132,6 +132,10 @@ def unit_noextras(session):
132
132
def mypy (session ):
133
133
"""Run type checks with mypy."""
134
134
135
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
136
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
137
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
138
+
135
139
session .install ("-e" , ".[all]" )
136
140
session .install (MYPY_VERSION )
137
141
@@ -153,6 +157,10 @@ def pytype(session):
153
157
# recent version avoids the error until a possibly better fix is found.
154
158
# https://github.com/googleapis/python-bigquery/issues/655
155
159
160
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
161
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
162
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
163
+
156
164
session .install ("attrs==20.3.0" )
157
165
session .install ("-e" , ".[all]" )
158
166
session .install (PYTYPE_VERSION )
@@ -213,6 +221,10 @@ def system(session):
213
221
def mypy_samples (session ):
214
222
"""Run type checks with mypy."""
215
223
224
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
225
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
226
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
227
+
216
228
session .install ("pytest" )
217
229
for requirements_path in CURRENT_DIRECTORY .glob ("samples/*/requirements.txt" ):
218
230
session .install ("-r" , str (requirements_path ))
@@ -394,6 +406,10 @@ def lint(session):
394
406
serious code quality issues.
395
407
"""
396
408
409
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
410
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
411
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
412
+
397
413
session .install ("flake8" , BLACK_VERSION )
398
414
session .install ("-e" , "." )
399
415
session .run ("flake8" , os .path .join ("google" , "cloud" , "bigquery" ))
@@ -408,6 +424,10 @@ def lint(session):
408
424
def lint_setup_py (session ):
409
425
"""Verify that setup.py is valid (including RST check)."""
410
426
427
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
428
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
429
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
430
+
411
431
session .install ("docutils" , "Pygments" )
412
432
session .run ("python" , "setup.py" , "check" , "--restructuredtext" , "--strict" )
413
433
@@ -418,6 +438,10 @@ def blacken(session):
418
438
Format code to uniform standard.
419
439
"""
420
440
441
+ # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
442
+ if os .environ .get ("RUN_LINTING_TYPING_TESTS" , "true" ) == "false" :
443
+ session .skip ("RUN_LINTING_TYPING_TESTS is set to false, skipping" )
444
+
421
445
session .install (BLACK_VERSION )
422
446
session .run ("black" , * BLACK_PATHS )
423
447
0 commit comments