Skip to content

feat: Add Python 3.13 runtime support #1211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ branchProtectionRules:
- 'Samples - Python 3.10'
- 'Samples - Python 3.11'
- 'Samples - Python 3.12'
- 'Samples - Python 3.13'

permissionRules:
- team: actools-python
permission: admin
Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
3.8, 3.9, 3.10, 3.11, 3.12, and 3.13 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.

- To run a single unit test::

$ nox -s unit-3.12 -- -k <name of test>
$ nox -s unit-3.13 -- -k <name of test>


.. note::
Expand Down Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system-3.12 -- -k <name of test>
$ nox -s system-3.13 -- -k <name of test>


.. note::

System tests are only configured to run under Python 3.8, 3.11 and 3.12.
System tests are only configured to run under Python 3.8, 3.12, and 3.13.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down Expand Up @@ -226,12 +226,14 @@ We support:
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_

.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/
.. _Python 3.12: https://docs.python.org/3.12/
.. _Python 3.13: https://docs.python.org/3.13/


Supported versions can be found in our ``noxfile.py`` `config`_.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies.

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.8
Python >= 3.8, <3.14

Unsupported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
19 changes: 12 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

DEFAULT_PYTHON_VERSION = "3.8"

UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"]
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
Expand Down Expand Up @@ -71,9 +71,14 @@
"geography",
"bqstorage",
],
"3.13": [
"tests",
"geography",
"bqstorage",
],
}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.11", "3.12"]
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.12", "3.13"]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
Expand All @@ -91,12 +96,12 @@
"alembic",
"bqstorage",
],
"3.11": [
"3.12": [
"tests",
"geography",
"bqstorage",
],
"3.12": [
"3.13": [
"tests",
"geography",
"bqstorage",
Expand Down Expand Up @@ -219,7 +224,7 @@ def unit(session, protobuf_implementation, install_extras=True):
)
install_unittest_dependencies(session, "-c", constraints_path)

if install_extras and session.python in ["3.11", "3.12"]:
if install_extras and session.python in ["3.11", "3.12", "3.13"]:
install_target = ".[geography,alembic,tests,bqstorage]"
elif install_extras:
install_target = ".[all]"
Expand Down Expand Up @@ -395,7 +400,7 @@ def compliance(session):
)
if session.python == "3.8":
extras = "[tests,alembic]"
elif session.python in ["3.11", "3.12"]:
elif session.python in ["3.12", "3.13"]:
extras = "[tests,geography]"
else:
extras = "[tests]"
Expand Down Expand Up @@ -522,7 +527,7 @@ def docfx(session):
)


@nox.session(python="3.12")
@nox.session(python="3.13")
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
Expand Down
5 changes: 3 additions & 2 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
"3.8": ["tests", "alembic", "bqstorage"],
"3.11": ["tests", "geography", "bqstorage"],
"3.12": ["tests", "geography", "bqstorage"],
"3.13": ["tests", "geography", "bqstorage"],
}
templated_files = common.py_library(
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12"],
system_test_python_versions=["3.8", "3.11", "3.12"],
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
system_test_python_versions=["3.8", "3.12", "3.13"],
cov_level=100,
unit_test_extras=extras,
unit_test_extras_by_python=extras_by_python,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def readme():
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Topic :: Database :: Front-Ends",
],
Expand All @@ -119,7 +120,7 @@ def readme():
"sqlalchemy>=1.4.16,<3.0.0",
],
extras_require=extras,
python_requires=">=3.8, <3.13",
python_requires=">=3.8, <3.14",
tests_require=["packaging", "pytz"],
entry_points={
"sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"]
Expand Down
14 changes: 1 addition & 13 deletions testing/constraints-3.13.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file.
# Pin the version to the lower bound.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core == 1.31.5
google-auth==1.25.0
google-cloud-bigquery==3.3.6
google-cloud-bigquery-storage == 2.0.0
grpcio == 1.47.0
pyarrow == 3.0.0
sqlalchemy==1.4.16
numpy>=1.23