From 3cb8491d67d65d2262aa1b65091ea9b615b583af Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 29 Oct 2025 12:04:55 -0400 Subject: [PATCH 1/2] feat: Add Python 3.14 support (#284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .github/sync-repo-settings.yaml | 1 + .github/workflows/lint.yml | 2 +- .github/workflows/unittest.yml | 4 ++-- .kokoro/presubmit/presubmit.cfg | 7 ++++++- noxfile.py | 15 ++++++++------- owlbot.py | 7 ++++++- setup.py | 1 + testing/constraints-3.14.txt | 0 testing/constraints-3.7.txt | 2 +- 9 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 testing/constraints-3.14.txt diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 10a8906..259abd5 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -17,6 +17,7 @@ branchProtectionRules: - 'unit (3.11)' - 'unit (3.12)' - 'unit (3.13)' + - 'unit (3.14)' - 'cover' permissionRules: - team: actools-python diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4866193..1051da0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 3049ba6..ca36354 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Checkout uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.kokoro/presubmit/presubmit.cfg b/.kokoro/presubmit/presubmit.cfg index 8f43917..f46ff2a 100644 --- a/.kokoro/presubmit/presubmit.cfg +++ b/.kokoro/presubmit/presubmit.cfg @@ -1 +1,6 @@ -# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "NOX_SESSION" + value: "blacken mypy check_lower_bounds" +} diff --git a/noxfile.py b/noxfile.py index 7217b33..4828f45 100644 --- a/noxfile.py +++ b/noxfile.py @@ -36,12 +36,13 @@ # Error if a python version is missing nox.options.error_on_missing_interpreters = True +DEFAULT_PYTHON_VERSION = "3.10" BLACK_VERSION = "black==23.7.0" BLACK_PATHS = ["test_utils", "setup.py"] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -57,7 +58,7 @@ def lint(session): session.run("flake8", *BLACK_PATHS) -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. @@ -70,14 +71,14 @@ def blacken(session): ) -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") session.run("python", "setup.py", "check", "--restructuredtext", "--strict") -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def mypy(session): """Verify type hints are mypy compatible.""" session.install("-e", ".") @@ -89,7 +90,7 @@ def mypy(session): session.run("mypy", "test_utils/", "tests/") -@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]) def unit(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" @@ -119,7 +120,7 @@ def unit(session): ) -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def check_lower_bounds(session): """Check lower bounds in setup.py are reflected in constraints file""" session.install(".") @@ -133,7 +134,7 @@ def check_lower_bounds(session): ) -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def update_lower_bounds(session): """Update lower bounds in constraints.txt to match setup.py""" session.install(".") diff --git a/owlbot.py b/owlbot.py index fdbf918..e720716 100644 --- a/owlbot.py +++ b/owlbot.py @@ -23,7 +23,11 @@ # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- -templated_files = common.py_library(cov_level=78) +templated_files = common.py_library( + cov_level=78, + unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"], + default_python_version="3.10", +) s.move( templated_files, excludes=[ @@ -37,6 +41,7 @@ "renovate.json", # no bundle, ignore test resources ".github/workflows/docs.yml", # no docs to publish "README.rst", + ".kokoro/presubmit/presubmit.cfg", # Manually managed ], ) diff --git a/setup.py b/setup.py index e12ad62..9b7b0c9 100644 --- a/setup.py +++ b/setup.py @@ -73,6 +73,7 @@ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Internet", "Topic :: Software Development :: Libraries :: Python Modules", ], diff --git a/testing/constraints-3.14.txt b/testing/constraints-3.14.txt new file mode 100644 index 0000000..e69de29 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index ed8f59f..e694520 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -1,4 +1,4 @@ click==7.0.0 google-auth==0.4.0 -importlib-metadata==1.0.0 +importlib_metadata==1.0.0 packaging==19.0 From 19dea9229b7ab4c4b617ea1d7625ddcde05619f7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:11:40 -0700 Subject: [PATCH 2/2] chore(main): release 1.7.0 (#285) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ test_utils/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f827a7d..92e78e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.7.0](https://github.com/googleapis/python-test-utils/compare/v1.6.4...v1.7.0) (2025-10-29) + + +### Features + +* Add Python 3.14 support ([#284](https://github.com/googleapis/python-test-utils/issues/284)) ([3cb8491](https://github.com/googleapis/python-test-utils/commit/3cb8491d67d65d2262aa1b65091ea9b615b583af)) + ## [1.6.4](https://github.com/googleapis/python-test-utils/compare/v1.6.3...v1.6.4) (2025-05-19) diff --git a/test_utils/version.py b/test_utils/version.py index c44ef12..3ed5ae3 100644 --- a/test_utils/version.py +++ b/test_utils/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.4" +__version__ = "1.7.0"