Skip to content

Commit ef7bc8b

Browse files
committed
build: update default python version to 3.12
1 parent b023de2 commit ef7bc8b

File tree

1 file changed

+3
-58
lines changed

1 file changed

+3
-58
lines changed

noxfile.py

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class = StreamHandler
7777

7878
BLACK_VERSION = "black==22.3.0"
7979
BLACK_PATHS = ["google", "test", "noxfile.py", "setup.py", "samples"]
80-
DEFAULT_PYTHON_VERSION = "3.8"
80+
DEFAULT_PYTHON_VERSION = "3.12"
8181
DEFAULT_PYTHON_VERSION_FOR_SQLALCHEMY_20 = "3.12"
8282

8383

@@ -126,50 +126,6 @@ def lint_setup_py(session):
126126
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
127127

128128

129-
@nox.session(python=DEFAULT_PYTHON_VERSION)
130-
def compliance_test_13(session):
131-
"""Run SQLAlchemy dialect compliance test suite."""
132-
133-
# Check the value of `RUN_COMPLIANCE_TESTS` env var. It defaults to true.
134-
if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false":
135-
session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping")
136-
# Sanity check: Only run tests if the environment variable is set.
137-
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get(
138-
"SPANNER_EMULATOR_HOST", ""
139-
):
140-
session.skip(
141-
"Credentials or emulator host must be set via environment variable"
142-
)
143-
144-
session.install(
145-
"pytest-cov",
146-
)
147-
148-
session.install("mock")
149-
session.install(".[tracing]")
150-
session.run("pip", "install", "sqlalchemy>=1.1.13,<=1.3.24", "--force-reinstall")
151-
session.run("pip", "install", "opentelemetry-api<=1.10", "--force-reinstall")
152-
session.run("pip", "install", "opentelemetry-sdk<=1.10", "--force-reinstall")
153-
session.run("python", "create_test_database.py")
154-
session.run("pip", "install", "pytest==6.2.2", "--force-reinstall")
155-
session.run(
156-
"pip", "install", "pytest-asyncio<0.21.0", "--force-reinstall", "--no-deps"
157-
)
158-
159-
session.run(
160-
"py.test",
161-
"--cov=google.cloud.sqlalchemy_spanner",
162-
"--cov=test",
163-
"--cov-append",
164-
"--cov-config=.coveragerc",
165-
"--cov-report=",
166-
"--cov-fail-under=0",
167-
"--asyncio-mode=auto",
168-
"test/test_suite_13.py",
169-
*session.posargs,
170-
)
171-
172-
173129
@nox.session(python=DEFAULT_PYTHON_VERSION)
174130
def compliance_test_14(session):
175131
"""Run SQLAlchemy dialect compliance test suite."""
@@ -334,14 +290,7 @@ def mockserver(session):
334290
@nox.session(python=DEFAULT_PYTHON_VERSION)
335291
def migration_test(session):
336292
"""Test migrations with SQLAlchemy v1.3.11+ and Alembic"""
337-
session.run("pip", "install", "sqlalchemy>=1.3.11,<2.0", "--force-reinstall")
338-
_migration_test(session)
339-
340-
341-
@nox.session(python=DEFAULT_PYTHON_VERSION)
342-
def migration_test_1310(session):
343-
"""Test migrations with SQLAlchemy 1.3.10 or lower and Alembic"""
344-
session.run("pip", "install", "sqlalchemy>=1.1.13,<=1.3.10", "--force-reinstall")
293+
session.run("pip", "install", "sqlalchemy>=1.4,<2.0", "--force-reinstall")
345294
_migration_test(session)
346295

347296

@@ -351,11 +300,7 @@ def _migration_test(session):
351300
import glob
352301
import os
353302
import shutil
354-
355-
try:
356-
import sqlalchemy
357-
except:
358-
session.run("pip", "install", "sqlalchemy>=1.3.11,<2.0", "--force-reinstall")
303+
import sqlalchemy
359304

360305
session.install("pytest")
361306
session.install(".")

0 commit comments

Comments
 (0)