Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35
deps: update all deps#413
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
62ee9e789b802a51be07b7659884d939f15fd1fa54d1e3e0dbb1d138ccaf8e19a0efde3334c83e8e97dbeff151eFile 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
| 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" | ||
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. 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() | ||
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. 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" | ||
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. 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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") | ||
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. 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): | ||
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. | ||
| 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.