-
Notifications
You must be signed in to change notification settings - Fork 35
deps: update all deps #413
Changes from all commits
62ee9e7
89b802a
51be07b
7659884
d939f15
fd1fa54
d1e3e0d
bb1d138
ccaf8e1
9a0efde
3334c83
e8e97db
eff151e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,5 @@ | |
| # Only run this nox session. | ||
| env_vars: { | ||
| key: "NOX_SESSION" | ||
| value: "compliance_test_20" | ||
| value: "unit" | ||
|
Contributor
Author
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. TODO in a next step: Remove this entire workflow. It is slow and not needed. The tests against the emulator should be enough. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,10 @@ def create_test_instance(): | |
| except AlreadyExists: | ||
| pass # instance was already created | ||
|
|
||
| if USE_EMULATOR: | ||
| database = instance.database("compliance-test") | ||
| database.drop() | ||
|
Contributor
Author
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. This ensures that each test really gets a fresh database. SQLAlchemy just ignored Note that |
||
|
|
||
| try: | ||
| database = instance.database("compliance-test") | ||
| created_op = database.create() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,9 +78,10 @@ class = StreamHandler | |
| BLACK_VERSION = "black==22.3.0" | ||
| BLACK_PATHS = ["google", "test", "noxfile.py", "setup.py", "samples"] | ||
| DEFAULT_PYTHON_VERSION = "3.8" | ||
| DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20 = "3.12" | ||
|
Contributor
Author
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. Run compliance tests for SQLAlchemy 2.0 on Python 3.12. That is a currently supported version (https://devguide.python.org/versions/) |
||
|
|
||
|
|
||
| @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| @nox.session(python=DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20) | ||
| def lint(session): | ||
| """Run linters. | ||
|
|
||
|
|
@@ -101,7 +102,7 @@ def lint(session): | |
| ) | ||
|
|
||
|
|
||
| @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| @nox.session(python=DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20) | ||
| def blacken(session): | ||
| """Run black. | ||
|
|
||
|
|
@@ -118,10 +119,10 @@ def blacken(session): | |
| ) | ||
|
|
||
|
|
||
| @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| @nox.session(python=DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20) | ||
| def lint_setup_py(session): | ||
| """Verify that setup.py is valid (including RST check).""" | ||
| session.install("docutils", "pygments") | ||
| session.install("docutils", "pygments", "setuptools") | ||
| session.run("python", "setup.py", "check", "--restructuredtext", "--strict") | ||
|
|
||
|
|
||
|
|
@@ -208,7 +209,7 @@ def compliance_test_14(session): | |
| ) | ||
|
|
||
|
|
||
| @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| @nox.session(python=DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20) | ||
| def compliance_test_20(session): | ||
| """Run SQLAlchemy dialect compliance test suite.""" | ||
|
|
||
|
|
@@ -255,12 +256,13 @@ def compliance_test_20(session): | |
| def unit(session): | ||
| """Run unit tests.""" | ||
| # Run SQLAlchemy dialect compliance test suite with OpenTelemetry. | ||
| session.install("setuptools") | ||
| session.install("pytest") | ||
| session.install("mock") | ||
| session.install(".") | ||
| session.install("opentelemetry-api==1.1.0") | ||
| session.install("opentelemetry-sdk==1.1.0") | ||
| session.install("opentelemetry-instrumentation==0.20b0") | ||
| session.install("opentelemetry-api==1.27.0") | ||
| session.install("opentelemetry-sdk==1.27.0") | ||
| session.install("opentelemetry-instrumentation==0.48b0") | ||
| session.run("python", "create_test_config.py", "my-project", "my-instance") | ||
| session.run("py.test", "--quiet", os.path.join("test/unit"), *session.posargs) | ||
|
|
||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,8 @@ | |
|
|
||
| import io | ||
| import os | ||
| import warnings | ||
|
|
||
| import setuptools | ||
|
|
||
|
|
||
|
|
@@ -59,24 +61,26 @@ | |
| if "google.cloud" in packages: | ||
| namespaces.append("google.cloud") | ||
|
|
||
| setuptools.setup( | ||
| author="Google LLC", | ||
| author_email="cloud-spanner-developers@googlegroups.com", | ||
| classifiers=["Intended Audience :: Developers"], | ||
| description=description, | ||
| long_description=readme, | ||
| entry_points={ | ||
| "sqlalchemy.dialects": [ | ||
| "spanner.spanner = google.cloud.sqlalchemy_spanner:SpannerDialect" | ||
| ] | ||
| }, | ||
| install_requires=dependencies, | ||
| extras_require=extras, | ||
| name=name, | ||
| namespace_packages=namespaces, | ||
| packages=packages, | ||
| url="https://github.com/cloudspannerecosystem/python-spanner-sqlalchemy", | ||
| version=version, | ||
| include_package_data=True, | ||
| zip_safe=False, | ||
| ) | ||
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("ignore") | ||
|
Contributor
Author
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. This makes sure that the tests do not fail due to a warning about deprecation being logged. |
||
| setuptools.setup( | ||
| author="Google LLC", | ||
| author_email="cloud-spanner-developers@googlegroups.com", | ||
| classifiers=["Intended Audience :: Developers"], | ||
| description=description, | ||
| long_description=readme, | ||
| entry_points={ | ||
| "sqlalchemy.dialects": [ | ||
| "spanner.spanner = google.cloud.sqlalchemy_spanner:SpannerDialect" | ||
| ] | ||
| }, | ||
| install_requires=dependencies, | ||
| extras_require=extras, | ||
| name=name, | ||
| namespace_packages=namespaces, | ||
| packages=packages, | ||
| url="https://github.com/cloudspannerecosystem/python-spanner-sqlalchemy", | ||
| version=version, | ||
| include_package_data=True, | ||
| zip_safe=False, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ def setup_class(cls): | |
| use_test_ot_exporter() | ||
| cls.ot_exporter = get_test_ot_exporter() | ||
|
|
||
| def teardown(self): | ||
| def teardown_method(self): | ||
|
Contributor
Author
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. |
||
| if HAS_OPENTELEMETRY_INSTALLED: | ||
| self.ot_exporter.clear() | ||
|
|
||
|
|
||
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.
This ensures that if
RUN_COMPLIANCE_TESTS=falsehas been set, then we only run the unit tests (and not lint, migration tests, etc.). All of those are covered by GitHub Actions runners.