From 25b4acdc0df373a4621d6e8eda9933ada6cba75f Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Tue, 25 Oct 2022 14:27:37 +0000 Subject: [PATCH 01/35] Sets cache support to false, removes upper req limit --- setup.py | 2 +- sqlalchemy_bigquery/base.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4afe003e..3d876748 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ def readme(): # https://github.com/googleapis/python-bigquery-sqlalchemy/issues/386 # and # https://github.com/googleapis/python-bigquery-sqlalchemy/issues/385 - "sqlalchemy>=1.2.0,<=1.4.27", + "sqlalchemy>=1.2.0", "future", ], extras_require=extras, diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index 3a26b330..32247a45 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -733,6 +733,7 @@ class BigQueryDialect(DefaultDialect): supports_default_values = False supports_empty_insert = False supports_multivalues_insert = True + supports_statement_cache = False supports_unicode_statements = True supports_unicode_binds = True supports_native_decimal = True From d57f51e96e865e595005be9e439ae184e1bda693 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 19:30:23 +0000 Subject: [PATCH 02/35] fix: sets upper limit to exclude sqlalchemy 2.0 (a breaking dependency) --- noxfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 0cb4e3f5..1a2d3937 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy", + "sqlalchemy<2.0.0dev", "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,6 +377,7 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", + "sqlalchemy<2.0.0dev", "-c", constraints_path, ) From a94270a1dea6ebf85f9c90c94bdd3ba7c761941b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 19:34:40 +0000 Subject: [PATCH 03/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1a2d3937..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy<2.0.0dev", + "sqlalchemy", "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,7 +377,6 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", - "sqlalchemy<2.0.0dev", "-c", constraints_path, ) From ef282fd6f53f7b5fa7df453bced6c2b9f61cdcc7 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 19:55:12 +0000 Subject: [PATCH 04/35] fix: sets upper limit to exclude rc and dev branches --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1a2d3937..a4cbeddb 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy<2.0.0dev", + "sqlalchemy<2.0.0", "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,7 +377,7 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", - "sqlalchemy<2.0.0dev", + "sqlalchemy<2.0.0", "-c", constraints_path, ) From 7307bd0a96336c1ccf38dceb6e9873d0825ff319 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 19:58:43 +0000 Subject: [PATCH 05/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index a4cbeddb..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy<2.0.0", + "sqlalchemy", "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,7 +377,6 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", - "sqlalchemy<2.0.0", "-c", constraints_path, ) From 07380c55fe589a88c8d9f204938c3fad3509ffef Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 20:09:52 +0000 Subject: [PATCH 06/35] add comment for testing purposes --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index a4cbeddb..5eef8e7e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy<2.0.0", + "sqlalchemy<2.0.0", # TODO remove comment "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,7 +377,7 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", - "sqlalchemy<2.0.0", + "sqlalchemy<2.0.0", # TODO remove comment "-c", constraints_path, ) From 5c11de2c022a6f7af44059b6868b5eec93a1168c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:13:39 +0000 Subject: [PATCH 07/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 5eef8e7e..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -294,7 +294,7 @@ def prerelease(session): "google-api-core", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "sqlalchemy<2.0.0", # TODO remove comment + "sqlalchemy", "shapely", # These are transitive dependencies, but we'd still like to know if a # change in a prerelease there breaks this connector. @@ -377,7 +377,6 @@ def compliance(session): "pytest<=7.0.0dev", "pytest-rerunfailures", "google-cloud-testutils", - "sqlalchemy<2.0.0", # TODO remove comment "-c", constraints_path, ) From 51f47167f0b4e6acff63cc98201d899e82c4e340 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 20:35:20 +0000 Subject: [PATCH 08/35] add sqlalchemy 20 to prerelease deps section --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 5eef8e7e..d431c4f0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -532,6 +532,7 @@ def prerelease_deps(session): "google-api-core", "proto-plus", "google-cloud-testutils", + "sqlalchemy<2.0.0dev", # dependencies of google-cloud-testutils" "click", ] From feda07e627feec837ecc86c6bfd62d8b9bf4b481 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:37:47 +0000 Subject: [PATCH 09/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index bd42acff..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -531,7 +531,6 @@ def prerelease_deps(session): "google-api-core", "proto-plus", "google-cloud-testutils", - "sqlalchemy<2.0.0dev", # dependencies of google-cloud-testutils" "click", ] From 24c05aa1f32aaf264d11ca0d55b8b038bb774b3f Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 20:43:47 +0000 Subject: [PATCH 10/35] remove prerelease entirely --- noxfile.py | 70 ------------------------------------------------------ 1 file changed, 70 deletions(-) diff --git a/noxfile.py b/noxfile.py index bd42acff..a87e6747 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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""" From 3345b61209270c7ab58e8dbf6012624d8906cf06 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:46:08 +0000 Subject: [PATCH 11/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/noxfile.py b/noxfile.py index 20463685..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,6 +283,76 @@ 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""" From 06b5b33ee265b4ba645c81587d44920ea4b62483 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 20:53:05 +0000 Subject: [PATCH 12/35] remove prerelease configs --- .kokoro/continuous/prerelease.cfg | 7 ------- .kokoro/presubmit/prerelease.cfg | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 .kokoro/continuous/prerelease.cfg delete mode 100644 .kokoro/presubmit/prerelease.cfg diff --git a/.kokoro/continuous/prerelease.cfg b/.kokoro/continuous/prerelease.cfg deleted file mode 100644 index 00bc8678..00000000 --- a/.kokoro/continuous/prerelease.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Only run this nox session. -env_vars: { - key: "NOX_SESSION" - value: "prerelease" -} diff --git a/.kokoro/presubmit/prerelease.cfg b/.kokoro/presubmit/prerelease.cfg deleted file mode 100644 index 00bc8678..00000000 --- a/.kokoro/presubmit/prerelease.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Only run this nox session. -env_vars: { - key: "NOX_SESSION" - value: "prerelease" -} From 90cc4bbe62eaf1c7ff21efb6599977cf687339a2 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 25 Jan 2023 20:54:34 +0000 Subject: [PATCH 13/35] removes prerelease nox session --- noxfile.py | 70 ------------------------------------------------------ 1 file changed, 70 deletions(-) diff --git a/noxfile.py b/noxfile.py index 0cb4e3f5..20463685 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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""" From 2951971e9574a8b5aa9ed99842bc14ffe021cf4c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 25 Jan 2023 20:56:34 +0000 Subject: [PATCH 14/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/noxfile.py b/noxfile.py index 20463685..0cb4e3f5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,6 +283,76 @@ 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""" From 2e485f500af27f87b2d978183d33184650d1fc79 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 13:37:43 +0000 Subject: [PATCH 15/35] testing changes to noxfile --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 20463685..f0e55726 100644 --- a/noxfile.py +++ b/noxfile.py @@ -461,6 +461,7 @@ def prerelease_deps(session): "google-api-core", "proto-plus", "google-cloud-testutils", + "sqlalchemy<2.0.0" # dependencies of google-cloud-testutils" "click", ] From f54f3f86c36694b1b6eb0ce0534d21299af11d0f Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 13:43:01 +0000 Subject: [PATCH 16/35] testing changes to noxfile --- noxfile.py | 70 ------------------------------------------------------ 1 file changed, 70 deletions(-) diff --git a/noxfile.py b/noxfile.py index d0d850d4..f0e55726 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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""" From 5eed6c45362cc8446aa185582d8aa4de18f26189 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 14:01:31 +0000 Subject: [PATCH 17/35] testing noxfiles redux --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index f0e55726..36ff5e17 100644 --- a/noxfile.py +++ b/noxfile.py @@ -425,7 +425,7 @@ def prerelease_deps(session): system_deps_all = ( SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES - + SYSTEM_TEST_EXTRAS + #+ SYSTEM_TEST_EXTRAS ) session.install(*system_deps_all) From 8fde268589b9de90de7e0df1d7f667bd6c4dac4a Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 14:17:43 +0000 Subject: [PATCH 18/35] testing noxfiles triplex --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 36ff5e17..cf592eff 100644 --- a/noxfile.py +++ b/noxfile.py @@ -461,7 +461,7 @@ def prerelease_deps(session): "google-api-core", "proto-plus", "google-cloud-testutils", - "sqlalchemy<2.0.0" + "sqlalchemy<2.0.0", # dependencies of google-cloud-testutils" "click", ] From f50cf65a0dd50c972a156c3dede499e04bdc14c9 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 14:37:56 +0000 Subject: [PATCH 19/35] testing noxfiles quadruplex --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index cf592eff..14a444f4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -425,7 +425,7 @@ def prerelease_deps(session): system_deps_all = ( SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES - #+ SYSTEM_TEST_EXTRAS + + SYSTEM_TEST_EXTRAS ) session.install(*system_deps_all) From 900060ed7cdfbac883c4a0dd3c7a070d5c7f5026 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 17:27:26 +0000 Subject: [PATCH 20/35] testing noxfiles again --- noxfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 14a444f4..4111f0cb 100644 --- a/noxfile.py +++ b/noxfile.py @@ -300,6 +300,8 @@ def compliance(session): 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. @@ -425,7 +427,6 @@ def prerelease_deps(session): system_deps_all = ( SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES - + SYSTEM_TEST_EXTRAS ) session.install(*system_deps_all) From 3ffecdd6365aa6dca8ea144b372b97ece25323c8 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 17:50:36 +0000 Subject: [PATCH 21/35] fixes linting --- noxfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 4111f0cb..fc2b2b35 100644 --- a/noxfile.py +++ b/noxfile.py @@ -425,8 +425,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_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES ) session.install(*system_deps_all) From 40d4673e66632c69d041c161920d7894145cfdab Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 18:55:24 +0000 Subject: [PATCH 22/35] Adds warning suppression constant --- tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py index 4efb155e..b6def7aa 100644 --- a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +++ b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py @@ -42,6 +42,9 @@ TimestampMicrosecondsTest as _TimestampMicrosecondsTest, ) +# To suppress the "Deprecated API features detected!" warning when features +# not compatible with 2.0 are detected: +SQLALCHEMY_SILENCE_UBER_WARNING=1 if packaging.version.parse(sqlalchemy.__version__) < packaging.version.parse("1.4"): from sqlalchemy.testing.suite import LimitOffsetTest as _LimitOffsetTest From 864fbbf74930ae562cdb3710dec342c5b4bc7260 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 19:55:54 +0000 Subject: [PATCH 23/35] Adds warning suppression constant to os.environ --- .../sqlalchemy_dialect_compliance/test_dialect_compliance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py index b6def7aa..d5485762 100644 --- a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +++ b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py @@ -19,6 +19,7 @@ import datetime import mock +import os import packaging.version import pytest import pytz @@ -43,8 +44,8 @@ ) # To suppress the "Deprecated API features detected!" warning when features -# not compatible with 2.0 are detected: -SQLALCHEMY_SILENCE_UBER_WARNING=1 +# not compatible with 2.0 are detected, use a value of 1 +os.environ['SQLALCHEMY_SILENCE_UBER_WARNING'] = 1 if packaging.version.parse(sqlalchemy.__version__) < packaging.version.parse("1.4"): from sqlalchemy.testing.suite import LimitOffsetTest as _LimitOffsetTest From df4e7cf1aa447b1bdfb40dfdfcf160dac1614214 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 20:05:54 +0000 Subject: [PATCH 24/35] Change variable setting from integer to string --- tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py index d5485762..b5931679 100644 --- a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +++ b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py @@ -45,7 +45,7 @@ # To suppress the "Deprecated API features detected!" warning when features # not compatible with 2.0 are detected, use a value of 1 -os.environ['SQLALCHEMY_SILENCE_UBER_WARNING'] = 1 +os.environ['SQLALCHEMY_SILENCE_UBER_WARNING'] = '1' if packaging.version.parse(sqlalchemy.__version__) < packaging.version.parse("1.4"): from sqlalchemy.testing.suite import LimitOffsetTest as _LimitOffsetTest From 87e0c3e18bab8765e093fad61224ef936caa8cdb Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Thu, 26 Jan 2023 20:52:04 +0000 Subject: [PATCH 25/35] Fixed linting --- .../sqlalchemy_dialect_compliance/test_dialect_compliance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py index b5931679..243bfea0 100644 --- a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +++ b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py @@ -43,9 +43,9 @@ TimestampMicrosecondsTest as _TimestampMicrosecondsTest, ) -# To suppress the "Deprecated API features detected!" warning when features +# To suppress the "Deprecated API features detected!" warning when features # not compatible with 2.0 are detected, use a value of 1 -os.environ['SQLALCHEMY_SILENCE_UBER_WARNING'] = '1' +os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1" if packaging.version.parse(sqlalchemy.__version__) < packaging.version.parse("1.4"): from sqlalchemy.testing.suite import LimitOffsetTest as _LimitOffsetTest From 3626d3a69b5b303f5acfa8ef4d302f9e024b014b Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 14:47:31 +0000 Subject: [PATCH 26/35] alternate attempt at including an env var --- noxfile.py | 5 +++++ .../sqlalchemy_dialect_compliance/test_dialect_compliance.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index fc2b2b35..25133b94 100644 --- a/noxfile.py +++ b/noxfile.py @@ -332,6 +332,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", + }, ) diff --git a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py index 243bfea0..4efb155e 100644 --- a/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +++ b/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py @@ -19,7 +19,6 @@ import datetime import mock -import os import packaging.version import pytest import pytz @@ -43,9 +42,6 @@ TimestampMicrosecondsTest as _TimestampMicrosecondsTest, ) -# To suppress the "Deprecated API features detected!" warning when features -# not compatible with 2.0 are detected, use a value of 1 -os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1" if packaging.version.parse(sqlalchemy.__version__) < packaging.version.parse("1.4"): from sqlalchemy.testing.suite import LimitOffsetTest as _LimitOffsetTest From 4feb6bad74a2aabb4165833b84dba6b56d1398a9 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 17:08:03 +0000 Subject: [PATCH 27/35] updates to owlbot and noxfile --- noxfile.py | 73 +++++------------------------------------- owlbot.py | 93 ++++++++++++------------------------------------------ 2 files changed, 29 insertions(+), 137 deletions(-) diff --git a/noxfile.py b/noxfile.py index 25133b94..bba541f7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,63 +283,6 @@ def system(session): ) -@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1]) -def compliance(session): - """Run the SQLAlchemy dialect-compliance system tests""" - constraints_path = str( - CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" - ) - system_test_folder_path = os.path.join("tests", "sqlalchemy_dialect_compliance") - - if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false": - session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping") - if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": - session.install("pyopenssl") - if not os.path.exists(system_test_folder_path): - 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. - # See: https://github.com/googleapis/python-bigquery-sqlalchemy/issues/413 - "pytest<=7.0.0dev", - "pytest-rerunfailures", - "google-cloud-testutils", - "-c", - constraints_path, - ) - if session.python == "3.8": - extras = "[tests,alembic]" - elif session.python == "3.11": - extras = "[tests,geography]" - else: - extras = "[tests]" - session.install("-e", f".{extras}", "-c", constraints_path) - - session.run( - "py.test", - "-vv", - f"--junitxml=compliance_{session.python}_sponge_log.xml", - "--reruns=3", - "--reruns-delay=60", - "--only-rerun=403 Exceeded rate limits", - "--only-rerun=409 Already Exists", - "--only-rerun=404 Not found", - "--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", - }, - ) - - @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -361,8 +304,6 @@ def docs(session): session.install( "sphinx==4.0.1", "alabaster", - "geoalchemy2", - "shapely", "recommonmark", ) @@ -389,8 +330,6 @@ def docfx(session): session.install( "sphinx==4.0.1", "alabaster", - "geoalchemy2", - "shapely", "recommonmark", "gcp-sphinx-docfx-yaml", ) @@ -430,7 +369,9 @@ 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_STANDARD_DEPENDENCIES + + SYSTEM_TEST_EXTERNAL_DEPENDENCIES + + SYSTEM_TEST_EXTRAS ) session.install(*system_deps_all) @@ -456,7 +397,8 @@ def prerelease_deps(session): session.install(*constraints_deps) prerel_deps = [ - "protobuf", + "sqlalchemy<2.0.0 +protobuf", # dependency of grpc "six", "googleapis-common-protos", @@ -466,7 +408,6 @@ def prerelease_deps(session): "google-api-core", "proto-plus", "google-cloud-testutils", - "sqlalchemy<2.0.0", # dependencies of google-cloud-testutils" "click", ] @@ -483,7 +424,9 @@ def prerelease_deps(session): # Print out prerelease package versions session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + "python", "-c", "import google.sqlalchemy<2.0.0 +protobuf; print(google.sqlalchemy<2.0.0 +protobuf.__version__)" ) session.run("python", "-c", "import grpc; print(grpc.__version__)") diff --git a/owlbot.py b/owlbot.py index 0b9a84fa..0c6917dd 100644 --- a/owlbot.py +++ b/owlbot.py @@ -72,10 +72,19 @@ "import re\nimport shutil", ) +s.replace( + ["noxfile.py"], + """SYSTEM_TEST_STANDARD_DEPENDENCIES + + SYSTEM_TEST_EXTERNAL_DEPENDENCIES + + SYSTEM_TEST_EXTRAS""", +"SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES", +) + s.replace( ["noxfile.py"], "--cov=google", "--cov=sqlalchemy_bigquery", ) + def place_before(path, text, *before_text, escape=None): replacement = "\n".join(before_text) + "\n" + text if escape: @@ -96,78 +105,13 @@ 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"), - ) +place_before( + "noxfile.py", + "protobuf", + "sqlalchemy<2.0.0", +) -''' # Maybe we can get rid of this when we don't need pytest-rerunfailures, # which we won't need when BQ retries itself: @@ -189,7 +133,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. @@ -220,6 +164,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", + }, ) @@ -229,7 +178,7 @@ def compliance(session): "noxfile.py", "@nox.session(python=DEFAULT_PYTHON_VERSION)\n" "def cover(session):", - prerelease + compliance, + prerelease_deps + compliance, escape="()", ) From 9e70f9596432d6e560b63c71974d163c760d5c21 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 17:17:40 +0000 Subject: [PATCH 28/35] clean up owlbot --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 0c6917dd..fd12bad5 100644 --- a/owlbot.py +++ b/owlbot.py @@ -109,7 +109,7 @@ def place_before(path, text, *before_text, escape=None): place_before( "noxfile.py", "protobuf", - "sqlalchemy<2.0.0", + "sqlalchemy<2.0.0,", ) From 0a6aff81263675c39578b533da28430e5c1c0a20 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 17:33:40 +0000 Subject: [PATCH 29/35] more revisions to owlbot --- owlbot.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/owlbot.py b/owlbot.py index fd12bad5..42d7e462 100644 --- a/owlbot.py +++ b/owlbot.py @@ -84,6 +84,12 @@ ["noxfile.py"], "--cov=google", "--cov=sqlalchemy_bigquery", ) +s.replace( + ["noxfile.py"], + "protobuf", + '''protobuf", + "sqlalchemy<2.0.0''', +) def place_before(path, text, *before_text, escape=None): replacement = "\n".join(before_text) + "\n" + text @@ -106,13 +112,6 @@ def place_before(path, text, *before_text, escape=None): ) -place_before( - "noxfile.py", - "protobuf", - "sqlalchemy<2.0.0,", -) - - # Maybe we can get rid of this when we don't need pytest-rerunfailures, # which we won't need when BQ retries itself: # https://github.com/googleapis/python-bigquery/pull/837 From 552dde79164a3fb72732e6908a46113985f2b213 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 17:57:47 +0000 Subject: [PATCH 30/35] testing a quirk in owlbot --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 42d7e462..8d1ac354 100644 --- a/owlbot.py +++ b/owlbot.py @@ -88,7 +88,7 @@ ["noxfile.py"], "protobuf", '''protobuf", - "sqlalchemy<2.0.0''', + "sqlalchemy<2.0.0TEST''', ) def place_before(path, text, *before_text, escape=None): From e31673b7edc9e6df1d1ea1d987da1121fc205214 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 18:01:29 +0000 Subject: [PATCH 31/35] testing a quirk in owlbot again --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 8d1ac354..42d7e462 100644 --- a/owlbot.py +++ b/owlbot.py @@ -88,7 +88,7 @@ ["noxfile.py"], "protobuf", '''protobuf", - "sqlalchemy<2.0.0TEST''', + "sqlalchemy<2.0.0''', ) def place_before(path, text, *before_text, escape=None): From 760d84f84c58b1a409b653562a6a18601c72b7b7 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 19:29:52 +0000 Subject: [PATCH 32/35] more testing of owlbot revisions --- owlbot.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/owlbot.py b/owlbot.py index 42d7e462..aac3da31 100644 --- a/owlbot.py +++ b/owlbot.py @@ -72,23 +72,26 @@ "import re\nimport shutil", ) + s.replace( - ["noxfile.py"], - """SYSTEM_TEST_STANDARD_DEPENDENCIES - + SYSTEM_TEST_EXTERNAL_DEPENDENCIES - + SYSTEM_TEST_EXTRAS""", -"SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES", + ["noxfile.py"], "--cov=google", "--cov=sqlalchemy_bigquery", ) + s.replace( - ["noxfile.py"], "--cov=google", "--cov=sqlalchemy_bigquery", + ["noxfile.py"], + "\+ SYSTEM_TEST_EXTRAS", + "", ) + s.replace( ["noxfile.py"], - "protobuf", - '''protobuf", - "sqlalchemy<2.0.0''', + '''"protobuf", + # dependency of grpc''', + '''"protobuf", + "sqlalchemy<2.0.0", + # dependency of grpc''', ) def place_before(path, text, *before_text, escape=None): @@ -177,7 +180,7 @@ def compliance(session): "noxfile.py", "@nox.session(python=DEFAULT_PYTHON_VERSION)\n" "def cover(session):", - prerelease_deps + compliance, + compliance, escape="()", ) From 985fae8c08ba7018467edac6b083cfe3d6b55a0f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 27 Jan 2023 19:31:59 +0000 Subject: [PATCH 33/35] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 71 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/noxfile.py b/noxfile.py index bba541f7..8a258f42 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,6 +283,61 @@ def system(session): ) +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1]) +def compliance(session): + """Run the SQLAlchemy dialect-compliance system tests""" + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) + system_test_folder_path = os.path.join("tests", "sqlalchemy_dialect_compliance") + + if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false": + session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping") + if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": + session.install("pyopenssl") + if not os.path.exists(system_test_folder_path): + 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. + # See: https://github.com/googleapis/python-bigquery-sqlalchemy/issues/413 + "pytest<=7.0.0dev", + "pytest-rerunfailures", + "google-cloud-testutils", + "-c", + constraints_path, + ) + if session.python == "3.8": + extras = "[tests,alembic]" + elif session.python == "3.11": + extras = "[tests,geography]" + else: + extras = "[tests]" + session.install("-e", f".{extras}", "-c", constraints_path) + + session.run( + "py.test", + "-vv", + f"--junitxml=compliance_{session.python}_sponge_log.xml", + "--reruns=3", + "--reruns-delay=60", + "--only-rerun=403 Exceeded rate limits", + "--only-rerun=409 Already Exists", + "--only-rerun=404 Not found", + "--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", + }, + ) + + @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -304,6 +359,8 @@ def docs(session): session.install( "sphinx==4.0.1", "alabaster", + "geoalchemy2", + "shapely", "recommonmark", ) @@ -330,6 +387,8 @@ def docfx(session): session.install( "sphinx==4.0.1", "alabaster", + "geoalchemy2", + "shapely", "recommonmark", "gcp-sphinx-docfx-yaml", ) @@ -369,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) @@ -397,8 +454,8 @@ def prerelease_deps(session): session.install(*constraints_deps) prerel_deps = [ - "sqlalchemy<2.0.0 -protobuf", + "protobuf", + "sqlalchemy<2.0.0", # dependency of grpc "six", "googleapis-common-protos", @@ -424,9 +481,7 @@ def prerelease_deps(session): # Print out prerelease package versions session.run( - "python", "-c", "import google.sqlalchemy<2.0.0 -protobuf; print(google.sqlalchemy<2.0.0 -protobuf.__version__)" + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" ) session.run("python", "-c", "import grpc; print(grpc.__version__)") From 4cd533bc14c0ecd9f107fb94170d69b3c526bd7b Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 21:23:42 +0000 Subject: [PATCH 34/35] updated readme and files with potential upper bounds --- README.rst | 3 +++ dev_requirements.txt | 2 +- testing/constraints-3.9.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index ca98bba0..d4b4ea68 100644 --- a/README.rst +++ b/README.rst @@ -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 ------------ diff --git a/dev_requirements.txt b/dev_requirements.txt index e7289070..17e4e6d0 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -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 diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt index eebb9da6..b7f3a762 100644 --- a/testing/constraints-3.9.txt +++ b/testing/constraints-3.9.txt @@ -1 +1 @@ -sqlalchemy>=1.4.13 +sqlalchemy>=1.4.,<2.0.0 From 2944309c2d43de585d6e5dd07a57e2fd25127b42 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Fri, 27 Jan 2023 21:27:34 +0000 Subject: [PATCH 35/35] update incorrect lower bound --- testing/constraints-3.9.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt index b7f3a762..77dc823a 100644 --- a/testing/constraints-3.9.txt +++ b/testing/constraints-3.9.txt @@ -1 +1 @@ -sqlalchemy>=1.4.,<2.0.0 +sqlalchemy>=1.4.13,<2.0.0