Skip to content

Commit 3cb8491

Browse files
feat: Add Python 3.14 support (#284)
* feat: Add Python 3.14 to noxfile.py * feat: Add Python 3.14 support * feat: Add 3.14 to repo settings * πŸ¦‰ Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Specify unit_test_python_versions in owlbot.py * πŸ¦‰ Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Update Kokoro presubmit sessions and default Nox Python * fix: Update lint workflow to use Python 3.13 * chore(ci): Set default python to 3.13 for linting * chore(ci): Revert default python to 3.10 for OwlBot compatibility * πŸ¦‰ Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(ci): Exclude presubmit.cfg from OwlBot management * chore(ci): Restore manually managed presubmit.cfg * Apply suggestion from @chalmerlowe * updates package name for older version of python --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent fa492cc commit 3cb8491

File tree

9 files changed

+26
-13
lines changed

9 files changed

+26
-13
lines changed

β€Ž.github/sync-repo-settings.yamlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ branchProtectionRules:
1717
- 'unit (3.11)'
1818
- 'unit (3.12)'
1919
- 'unit (3.13)'
20+
- 'unit (3.14)'
2021
- 'cover'
2122
permissionRules:
2223
- team: actools-python

β€Ž.github/workflows/lint.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Python
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.8"
15+
python-version: "3.10"
1616
- name: Install nox
1717
run: |
1818
python -m pip install --upgrade setuptools pip wheel

β€Ž.github/workflows/unittest.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-22.04
1212
strategy:
1313
matrix:
14-
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
14+
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4
@@ -45,7 +45,7 @@ jobs:
4545
- name: Setup Python
4646
uses: actions/setup-python@v5
4747
with:
48-
python-version: "3.8"
48+
python-version: "3.10"
4949
- name: Install coverage
5050
run: |
5151
python -m pip install --upgrade setuptools pip wheel
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "NOX_SESSION"
5+
value: "blacken mypy check_lower_bounds"
6+
}

β€Žnoxfile.pyβ€Ž

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@
3636
# Error if a python version is missing
3737
nox.options.error_on_missing_interpreters = True
3838

39+
DEFAULT_PYTHON_VERSION = "3.10"
3940
BLACK_VERSION = "black==23.7.0"
4041
BLACK_PATHS = ["test_utils", "setup.py"]
4142
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4243

4344

44-
@nox.session(python="3.8")
45+
@nox.session(python=DEFAULT_PYTHON_VERSION)
4546
def lint(session):
4647
"""Run linters.
4748
@@ -57,7 +58,7 @@ def lint(session):
5758
session.run("flake8", *BLACK_PATHS)
5859

5960

60-
@nox.session(python="3.8")
61+
@nox.session(python=DEFAULT_PYTHON_VERSION)
6162
def blacken(session):
6263
"""Run black.
6364
@@ -70,14 +71,14 @@ def blacken(session):
7071
)
7172

7273

73-
@nox.session(python="3.8")
74+
@nox.session(python=DEFAULT_PYTHON_VERSION)
7475
def lint_setup_py(session):
7576
"""Verify that setup.py is valid (including RST check)."""
7677
session.install("docutils", "pygments")
7778
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
7879

7980

80-
@nox.session(python="3.8")
81+
@nox.session(python=DEFAULT_PYTHON_VERSION)
8182
def mypy(session):
8283
"""Verify type hints are mypy compatible."""
8384
session.install("-e", ".")
@@ -89,7 +90,7 @@ def mypy(session):
8990
session.run("mypy", "test_utils/", "tests/")
9091

9192

92-
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
93+
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"])
9394
def unit(session):
9495
constraints_path = str(
9596
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
@@ -119,7 +120,7 @@ def unit(session):
119120
)
120121

121122

122-
@nox.session(python="3.8")
123+
@nox.session(python=DEFAULT_PYTHON_VERSION)
123124
def check_lower_bounds(session):
124125
"""Check lower bounds in setup.py are reflected in constraints file"""
125126
session.install(".")
@@ -133,7 +134,7 @@ def check_lower_bounds(session):
133134
)
134135

135136

136-
@nox.session(python="3.8")
137+
@nox.session(python=DEFAULT_PYTHON_VERSION)
137138
def update_lower_bounds(session):
138139
"""Update lower bounds in constraints.txt to match setup.py"""
139140
session.install(".")

β€Žowlbot.pyβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
# ----------------------------------------------------------------------------
2424
# Add templated files
2525
# ----------------------------------------------------------------------------
26-
templated_files = common.py_library(cov_level=78)
26+
templated_files = common.py_library(
27+
cov_level=78,
28+
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
29+
default_python_version="3.10",
30+
)
2731
s.move(
2832
templated_files,
2933
excludes=[
@@ -37,6 +41,7 @@
3741
"renovate.json", # no bundle, ignore test resources
3842
".github/workflows/docs.yml", # no docs to publish
3943
"README.rst",
44+
".kokoro/presubmit/presubmit.cfg", # Manually managed
4045
],
4146
)
4247

β€Žsetup.pyβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"Programming Language :: Python :: 3.11",
7474
"Programming Language :: Python :: 3.12",
7575
"Programming Language :: Python :: 3.13",
76+
"Programming Language :: Python :: 3.14",
7677
"Topic :: Internet",
7778
"Topic :: Software Development :: Libraries :: Python Modules",
7879
],

β€Žtesting/constraints-3.14.txtβ€Ž

Whitespace-only changes.

β€Žtesting/constraints-3.7.txtβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
click==7.0.0
22
google-auth==0.4.0
3-
importlib-metadata==1.0.0
3+
importlib_metadata==1.0.0
44
packaging==19.0

0 commit comments

Comments
Β (0)