Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
25b4acd
Sets cache support to false, removes upper req limit
chalmerlowe Oct 25, 2022
68dce2f
merge
chalmerlowe Jan 23, 2023
d57f51e
fix: sets upper limit to exclude sqlalchemy 2.0 (a breaking dependency)
chalmerlowe Jan 25, 2023
a94270a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
ef282fd
fix: sets upper limit to exclude rc and dev branches
chalmerlowe Jan 25, 2023
6dc8892
fixes merge
chalmerlowe Jan 25, 2023
7307bd0
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
07380c5
add comment for testing purposes
chalmerlowe Jan 25, 2023
4e968d9
fix merge conflict
chalmerlowe Jan 25, 2023
5c11de2
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
51f4716
add sqlalchemy 20 to prerelease deps section
chalmerlowe Jan 25, 2023
89d18b0
Merge branch 'avoid-sqlalchemy20' of github.com:googleapis/python-big…
chalmerlowe Jan 25, 2023
feda07e
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
24c05aa
remove prerelease entirely
chalmerlowe Jan 25, 2023
909a97f
Merge branch 'avoid-sqlalchemy20' of github.com:googleapis/python-big…
chalmerlowe Jan 25, 2023
3345b61
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
06b5b33
remove prerelease configs
chalmerlowe Jan 25, 2023
791bd09
Merge branch 'avoid-sqlalchemy20' of github.com:googleapis/python-big…
chalmerlowe Jan 25, 2023
90cc4bb
removes prerelease nox session
chalmerlowe Jan 25, 2023
2951971
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 25, 2023
2e485f5
testing changes to noxfile
chalmerlowe Jan 26, 2023
ae27ceb
Merge branch 'avoid-sqlalchemy20' of github.com:googleapis/python-big…
chalmerlowe Jan 26, 2023
f54f3f8
testing changes to noxfile
chalmerlowe Jan 26, 2023
5eed6c4
testing noxfiles redux
chalmerlowe Jan 26, 2023
8fde268
testing noxfiles triplex
chalmerlowe Jan 26, 2023
f50cf65
testing noxfiles quadruplex
chalmerlowe Jan 26, 2023
900060e
testing noxfiles again
chalmerlowe Jan 26, 2023
3ffecdd
fixes linting
chalmerlowe Jan 26, 2023
40d4673
Adds warning suppression constant
chalmerlowe Jan 26, 2023
864fbbf
Adds warning suppression constant to os.environ
chalmerlowe Jan 26, 2023
df4e7cf
Change variable setting from integer to string
chalmerlowe Jan 26, 2023
87e0c3e
Fixed linting
chalmerlowe Jan 26, 2023
3626d3a
alternate attempt at including an env var
chalmerlowe Jan 27, 2023
4feb6ba
updates to owlbot and noxfile
chalmerlowe Jan 27, 2023
9e70f95
clean up owlbot
chalmerlowe Jan 27, 2023
0a6aff8
more revisions to owlbot
chalmerlowe Jan 27, 2023
552dde7
testing a quirk in owlbot
chalmerlowe Jan 27, 2023
e31673b
testing a quirk in owlbot again
chalmerlowe Jan 27, 2023
760d84f
more testing of owlbot revisions
chalmerlowe Jan 27, 2023
985fae8
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jan 27, 2023
4cd533b
updated readme and files with potential upper bounds
chalmerlowe Jan 27, 2023
e6014e5
Merge branch 'avoid-sqlalchemy20' of github.com:googleapis/python-big…
chalmerlowe Jan 27, 2023
2944309
update incorrect lower bound
chalmerlowe Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .kokoro/continuous/prerelease.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/presubmit/prerelease.cfg

This file was deleted.

3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ In order to use this library, you first need to go through the following steps:
.. _Enable the BigQuery Storage API.: https://console.cloud.google.com/apis/library/bigquery.googleapis.com
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

.. note::
This library is only compatible with SQLAlchemy versions < 2.0.0

Installation
------------

Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sqlalchemy>=1.1.9
sqlalchemy>=1.1.9,<2.0.0
google-cloud-bigquery>=1.6.0
future==0.18.2
pytest===6.2.5
Expand Down
82 changes: 8 additions & 74 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,76 +283,6 @@ def system(session):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def prerelease(session):
session.install(
"--prefer-binary",
"--pre",
"--upgrade",
"alembic",
"geoalchemy2",
"google-api-core",
"google-cloud-bigquery",
"google-cloud-bigquery-storage",
"sqlalchemy",
"shapely",
# These are transitive dependencies, but we'd still like to know if a
# change in a prerelease there breaks this connector.
"google-cloud-core",
"grpcio",
)
session.install(
"freezegun",
"google-cloud-testutils",
"mock",
"psutil",
"pytest",
"pytest-cov",
"pytz",
)

# Because we test minimum dependency versions on the minimum Python
# version, the first version we test with in the unit tests sessions has a
# constraints file containing all dependencies and extras.
with open(
CURRENT_DIRECTORY
/ "testing"
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
encoding="utf-8",
) as constraints_file:
constraints_text = constraints_file.read()

# Ignore leading whitespace and comment lines.
deps = [
match.group(1)
for match in re.finditer(
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
)
]

# We use --no-deps to ensure that pre-release versions aren't overwritten
# by the version ranges in setup.py.
session.install(*deps)
session.install("--no-deps", "-e", ".")

# Print out prerelease package versions.
session.run("python", "-m", "pip", "freeze")

# Run all tests, except a few samples tests which require extra dependencies.
session.run(
"py.test",
"--quiet",
f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml",
os.path.join("tests", "unit"),
)
session.run(
"py.test",
"--quiet",
f"--junitxml=prerelease_system_{session.python}_sponge_log.xml",
os.path.join("tests", "system"),
)


@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1])
def compliance(session):
"""Run the SQLAlchemy dialect-compliance system tests"""
Expand All @@ -369,7 +299,7 @@ def compliance(session):
session.skip("Compliance tests were not found")

session.install("--pre", "grpcio")

session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the goal with the upgrade + constraint is to pick up the latest of everything but sqlalchemy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constraint is to ensure that we install a prerelease version of sqlalchemy up to but not including 2.0.0.

session.install(
"mock",
# TODO: Allow latest version of pytest once SQLAlchemy 1.4.28+ is supported.
Expand Down Expand Up @@ -400,6 +330,11 @@ def compliance(session):
"--only-rerun=400 Cannot execute DML over a non-existent table",
system_test_folder_path,
*session.posargs,
# To suppress the "Deprecated API features detected!" warning when
# features not compatible with 2.0 are detected, use a value of "1"
env={
"SQLALCHEMY_SILENCE_UBER_WARNING": "1",
},
)


Expand Down Expand Up @@ -493,9 +428,7 @@ def prerelease_deps(session):
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
session.install(*unit_deps_all)
system_deps_all = (
SYSTEM_TEST_STANDARD_DEPENDENCIES
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
+ SYSTEM_TEST_EXTRAS
SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES
)
session.install(*system_deps_all)

Expand All @@ -522,6 +455,7 @@ def prerelease_deps(session):

prerel_deps = [
"protobuf",
"sqlalchemy<2.0.0",
# dependency of grpc
"six",
"googleapis-common-protos",
Expand Down
99 changes: 25 additions & 74 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,28 @@
"import re\nimport shutil",
)


s.replace(
["noxfile.py"], "--cov=google", "--cov=sqlalchemy_bigquery",
)


s.replace(
["noxfile.py"],
"\+ SYSTEM_TEST_EXTRAS",
"",
)


s.replace(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always worry about brittleness with these kinds of replacements, but alas that's problem for future us.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you and me both.
i really disliked these s.replace() functions as I was writing them.

["noxfile.py"],
'''"protobuf",
# dependency of grpc''',
'''"protobuf",
"sqlalchemy<2.0.0",
# dependency of grpc''',
)

def place_before(path, text, *before_text, escape=None):
replacement = "\n".join(before_text) + "\n" + text
if escape:
Expand All @@ -96,78 +114,6 @@ def place_before(path, text, *before_text, escape=None):
"nox.options.stop_on_first_error = True",
)

prerelease = r'''
@nox.session(python=DEFAULT_PYTHON_VERSION)
def prerelease(session):
session.install(
"--prefer-binary",
"--pre",
"--upgrade",
"alembic",
"geoalchemy2",
"google-api-core",
"google-cloud-bigquery",
"google-cloud-bigquery-storage",
"sqlalchemy",
"shapely",
# These are transitive dependencies, but we'd still like to know if a
# change in a prerelease there breaks this connector.
"google-cloud-core",
"grpcio",
)
session.install(
"freezegun",
"google-cloud-testutils",
"mock",
"psutil",
"pytest",
"pytest-cov",
"pytz",
)

# Because we test minimum dependency versions on the minimum Python
# version, the first version we test with in the unit tests sessions has a
# constraints file containing all dependencies and extras.
with open(
CURRENT_DIRECTORY
/ "testing"
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
encoding="utf-8",
) as constraints_file:
constraints_text = constraints_file.read()

# Ignore leading whitespace and comment lines.
deps = [
match.group(1)
for match in re.finditer(
r"^\\s*(\\S+)(?===\\S+)", constraints_text, flags=re.MULTILINE
)
]

# We use --no-deps to ensure that pre-release versions aren't overwritten
# by the version ranges in setup.py.
session.install(*deps)
session.install("--no-deps", "-e", ".")

# Print out prerelease package versions.
session.run("python", "-m", "pip", "freeze")

# Run all tests, except a few samples tests which require extra dependencies.
session.run(
"py.test",
"--quiet",
f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml",
os.path.join("tests", "unit"),
)
session.run(
"py.test",
"--quiet",
f"--junitxml=prerelease_system_{session.python}_sponge_log.xml",
os.path.join("tests", "system"),
)


'''

# Maybe we can get rid of this when we don't need pytest-rerunfailures,
# which we won't need when BQ retries itself:
Expand All @@ -189,7 +135,7 @@ def compliance(session):
session.skip("Compliance tests were not found")

session.install("--pre", "grpcio")

session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0")
session.install(
"mock",
# TODO: Allow latest version of pytest once SQLAlchemy 1.4.28+ is supported.
Expand Down Expand Up @@ -220,6 +166,11 @@ def compliance(session):
"--only-rerun=400 Cannot execute DML over a non-existent table",
system_test_folder_path,
*session.posargs,
# To suppress the "Deprecated API features detected!" warning when
# features not compatible with 2.0 are detected, use a value of "1"
env={
"SQLALCHEMY_SILENCE_UBER_WARNING": "1",
},
)


Expand All @@ -229,7 +180,7 @@ def compliance(session):
"noxfile.py",
"@nox.session(python=DEFAULT_PYTHON_VERSION)\n"
"def cover(session):",
prerelease + compliance,
compliance,
escape="()",
)

Expand Down
2 changes: 1 addition & 1 deletion testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sqlalchemy>=1.4.13
sqlalchemy>=1.4.13,<2.0.0