Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit 8af7c47

Browse files
committed
Revert "adds debugging to noxfile and tweaks to correct coverage"
This reverts commit 4e86c04.
1 parent a9881fa commit 8af7c47

File tree

4 files changed

+5
-67
lines changed

4 files changed

+5
-67
lines changed

noxfile.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818

1919
from __future__ import absolute_import
2020

21-
from functools import wraps
2221
import os
2322
import pathlib
2423
import re
2524
import shutil
26-
import time
2725
from typing import Dict, List
2826
import warnings
2927

@@ -102,27 +100,6 @@
102100

103101
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
104102

105-
106-
def _calculate_duration(func):
107-
"""This decorator prints the execution time for the decorated function."""
108-
109-
@wraps(func)
110-
def wrapper(*args, **kwargs):
111-
start = time.monotonic()
112-
result = func(*args, **kwargs)
113-
end = time.monotonic()
114-
total_seconds = round(end - start)
115-
hours = total_seconds // 3600 # Integer division to get hours
116-
remaining_seconds = total_seconds % 3600 # Modulo to find remaining seconds
117-
minutes = remaining_seconds // 60
118-
seconds = remaining_seconds % 60
119-
human_time = f"{hours:}:{minutes:0>2}:{seconds:0>2}"
120-
print(f"Session ran in {total_seconds} seconds ({human_time})")
121-
return result
122-
123-
return wrapper
124-
125-
126103
nox.options.sessions = [
127104
"unit",
128105
"system",
@@ -141,15 +118,13 @@ def wrapper(*args, **kwargs):
141118

142119

143120
@nox.session(python=DEFAULT_PYTHON_VERSION)
144-
@_calculate_duration
145121
def lint(session):
146122
"""Run linters.
147123
148124
Returns a failure if the linters find linting errors or sufficiently
149125
serious code quality issues.
150126
"""
151127
session.install(FLAKE8_VERSION, BLACK_VERSION)
152-
session.run("python", "-m", "pip", "freeze")
153128
session.run(
154129
"black",
155130
"--check",
@@ -159,19 +134,16 @@ def lint(session):
159134

160135

161136
@nox.session(python=DEFAULT_PYTHON_VERSION)
162-
@_calculate_duration
163137
def blacken(session):
164138
"""Run black. Format code to uniform standard."""
165139
session.install(BLACK_VERSION)
166-
session.run("python", "-m", "pip", "freeze")
167140
session.run(
168141
"black",
169142
*LINT_PATHS,
170143
)
171144

172145

173146
@nox.session(python=DEFAULT_PYTHON_VERSION)
174-
@_calculate_duration
175147
def format(session):
176148
"""
177149
Run isort to sort imports. Then run black
@@ -180,7 +152,6 @@ def format(session):
180152
session.install(BLACK_VERSION, ISORT_VERSION)
181153
# Use the --fss option to sort imports using strict alphabetical order.
182154
# See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections
183-
session.run("python", "-m", "pip", "freeze")
184155
session.run(
185156
"isort",
186157
"--fss",
@@ -193,11 +164,9 @@ def format(session):
193164

194165

195166
@nox.session(python=DEFAULT_PYTHON_VERSION)
196-
@_calculate_duration
197167
def lint_setup_py(session):
198168
"""Verify that setup.py is valid (including RST check)."""
199169
session.install("docutils", "pygments")
200-
session.run("python", "-m", "pip", "freeze")
201170
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
202171

203172

@@ -234,7 +203,6 @@ def install_unittest_dependencies(session, *constraints):
234203
"protobuf_implementation",
235204
["python", "upb", "cpp"],
236205
)
237-
@_calculate_duration
238206
def unit(session, protobuf_implementation, install_extras=True):
239207
# Install all test dependencies, then install this package in-place.
240208

@@ -261,7 +229,6 @@ def unit(session, protobuf_implementation, install_extras=True):
261229
session.install("protobuf<4")
262230

263231
# Run py.test against the unit tests.
264-
session.run("python", "-m", "pip", "freeze")
265232
session.run(
266233
"py.test",
267234
"--quiet",
@@ -311,7 +278,6 @@ def install_systemtest_dependencies(session, *constraints):
311278

312279

313280
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
314-
@_calculate_duration
315281
def system(session):
316282
"""Run the system test suite."""
317283
constraints_path = str(
@@ -334,7 +300,6 @@ def system(session):
334300
session.skip("System tests were not found")
335301

336302
install_systemtest_dependencies(session, "-c", constraints_path)
337-
session.run("python", "-m", "pip", "freeze")
338303

339304
# Run py.test against the system tests.
340305
if system_test_exists:
@@ -356,7 +321,6 @@ def system(session):
356321

357322

358323
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
359-
@_calculate_duration
360324
def system_noextras(session):
361325
"""Run the system test suite."""
362326
constraints_path = str(
@@ -381,7 +345,6 @@ def system_noextras(session):
381345
global SYSTEM_TEST_EXTRAS_BY_PYTHON
382346
SYSTEM_TEST_EXTRAS_BY_PYTHON = False
383347
install_systemtest_dependencies(session, "-c", constraints_path)
384-
session.run("python", "-m", "pip", "freeze")
385348

386349
# Run py.test against the system tests.
387350
if system_test_exists:
@@ -403,7 +366,6 @@ def system_noextras(session):
403366

404367

405368
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1])
406-
@_calculate_duration
407369
def compliance(session):
408370
"""Run the SQLAlchemy dialect-compliance system tests"""
409371
constraints_path = str(
@@ -456,22 +418,19 @@ def compliance(session):
456418

457419

458420
@nox.session(python=DEFAULT_PYTHON_VERSION)
459-
@_calculate_duration
460421
def cover(session):
461422
"""Run the final coverage report.
462423
463424
This outputs the coverage report aggregating coverage from the unit
464425
test runs (not system test runs), and then erases coverage data.
465426
"""
466427
session.install("coverage", "pytest-cov")
467-
session.run("python", "-m", "pip", "freeze")
468428
session.run("coverage", "report", "--show-missing", "--fail-under=100")
469429

470430
session.run("coverage", "erase")
471431

472432

473433
@nox.session(python="3.10")
474-
@_calculate_duration
475434
def docs(session):
476435
"""Build the docs for this library."""
477436

@@ -494,7 +453,6 @@ def docs(session):
494453
)
495454

496455
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
497-
session.run("python", "-m", "pip", "freeze")
498456
session.run(
499457
"sphinx-build",
500458
"-W", # warnings as errors
@@ -510,7 +468,6 @@ def docs(session):
510468

511469

512470
@nox.session(python="3.10")
513-
@_calculate_duration
514471
def docfx(session):
515472
"""Build the docfx yaml files for this library."""
516473

@@ -533,7 +490,6 @@ def docfx(session):
533490
)
534491

535492
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
536-
session.run("python", "-m", "pip", "freeze")
537493
session.run(
538494
"sphinx-build",
539495
"-T", # show full traceback on exception
@@ -564,7 +520,6 @@ def docfx(session):
564520
"protobuf_implementation",
565521
["python", "upb", "cpp"],
566522
)
567-
@_calculate_duration
568523
def prerelease_deps(session, protobuf_implementation):
569524
"""Run all tests with prerelease versions of dependencies installed."""
570525

@@ -626,7 +581,6 @@ def prerelease_deps(session, protobuf_implementation):
626581
"requests",
627582
]
628583
session.install(*other_deps)
629-
session.run("python", "-m", "pip", "freeze")
630584

631585
# Print out prerelease package versions
632586
session.run(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def readme():
6262
# https://github.com/grpc/grpc/pull/15254
6363
"grpcio >= 1.47.0, < 2.0.0",
6464
"grpcio >= 1.49.1, < 2.0.0; python_version>='3.11'",
65-
"pyarrow >= 5.0.0",
65+
"pyarrow >= 3.0.0",
6666
],
6767
}
6868

sqlalchemy_bigquery/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@
4848
from . import _versions_helpers
4949

5050
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
51-
# Now that support for Python 3.7 and 3.8 has been removed, we don't expect the
52-
# following check to succeed. The warning is only included for robustness.
53-
if sys_major == 3 and sys_minor in (7, 8): # pragma: NO COVER
51+
if sys_major == 3 and sys_minor in (7, 8):
5452
warnings.warn(
55-
"The python-bigquery-sqlalchemy library no longer supports Python 3.7 "
56-
"and Python 3.8. "
53+
"The python-bigquery library will stop supporting Python 3.7 "
54+
"and Python 3.8 in a future major release expected in Q4 2024. "
5755
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
5856
"recommend that you update soon to ensure ongoing support. For "
5957
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
60-
FutureWarning,
58+
PendingDeprecationWarning,
6159
)
6260

6361

testing/constraints-3.9.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +0,0 @@
1-
# This constraints file is used to check that lower bounds
2-
# are correct in setup.py
3-
# List *all* library dependencies and extras in this file.
4-
# Pin the version to the lower bound.
5-
#
6-
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7-
sqlalchemy==1.4.16
8-
google-auth==1.25.0
9-
google-cloud-bigquery==3.3.6
10-
google-cloud-bigquery-storage==2.0.0
11-
google-api-core==1.31.5
12-
grpcio==1.47.0
13-
numpy==1.26.4
14-
pyarrow==5.0.0

0 commit comments

Comments
 (0)