Skip to content

Commit d32d670

Browse files
committed
refactor: use explicit Python version variables for ruff formatting and constraints file selection in nox sessions.
1 parent cdd9798 commit d32d670

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • packages/google-cloud-spanner-dbapi-driver

packages/google-cloud-spanner-dbapi-driver/noxfile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def lint(session):
164164
"ruff",
165165
"format",
166166
"--check",
167-
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
167+
f"--target-version=py{DEFAULT_PYTHON_VERSION.replace('.', '')}",
168168
"--line-length=88",
169169
*LINT_PATHS,
170170
)
@@ -189,7 +189,7 @@ def format(session):
189189
"--select",
190190
"I",
191191
"--fix",
192-
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
192+
f"--target-version=py{DEFAULT_PYTHON_VERSION.replace('.', '')}",
193193
"--line-length=88", # Standard Black line length
194194
*LINT_PATHS,
195195
)
@@ -198,7 +198,7 @@ def format(session):
198198
session.run(
199199
"ruff",
200200
"format",
201-
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
201+
f"--target-version=py{DEFAULT_PYTHON_VERSION.replace('.', '')}",
202202
"--line-length=88", # Standard Black line length
203203
*LINT_PATHS,
204204
)
@@ -460,7 +460,7 @@ def prerelease_deps(session):
460460
# version, the first version we test with in the unit tests sessions has a
461461
# constraints file containing all dependencies and extras.
462462
with open(
463-
CURRENT_DIRECTORY / "testing" / f"constraints-{ALL_PYTHON[0]}.txt",
463+
CURRENT_DIRECTORY / "testing" / f"constraints-{PREVIEW_PYTHON_VERSION}.txt",
464464
encoding="utf-8",
465465
) as constraints_file:
466466
constraints_text = constraints_file.read()
@@ -536,7 +536,7 @@ def core_deps_from_source(session):
536536
# version, the first version we test with in the unit tests sessions has a
537537
# constraints file containing all dependencies and extras.
538538
with open(
539-
CURRENT_DIRECTORY / "testing" / f"constraints-{ALL_PYTHON[0]}.txt",
539+
CURRENT_DIRECTORY / "testing" / f"constraints-{DEFAULT_PYTHON_VERSION}.txt",
540540
encoding="utf-8",
541541
) as constraints_file:
542542
constraints_text = constraints_file.read()

0 commit comments

Comments
 (0)