Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 140
fix: Avoid sqlalchemy20#736
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
25b4acd68dce2fd57f51ea94270aef282fd6dc88927307bd007380c54e968d95c11de251f471689d18b0feda07e24c05aa909a97f3345b6106b5b33791bd0990cc4bb29519712e485f5ae27cebf54f3f85eed6c48fde268f50cf65900060e3ffecdd40d4673864fbbfdf4e7cf87e0c3e3626d3a4feb6ba9e70f950a6aff8552dde7e31673b760d84f985fae84cd533be6014e52944309File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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( | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you and me both. | ||
| ["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: | ||
| @@ -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: | ||
| @@ -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. | ||
| @@ -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", | ||
| }, | ||
| ) | ||
| @@ -229,7 +180,7 @@ def compliance(session): | ||
| "noxfile.py", | ||
| "@nox.session(python=DEFAULT_PYTHON_VERSION)\n" | ||
| "def cover(session):", | ||
| prerelease + compliance, | ||
| compliance, | ||
| escape="()", | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| sqlalchemy>=1.4.13 | ||
| sqlalchemy>=1.4.13,<2.0.0 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.