diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 453b540c1..eb4d9f794 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
- digest: sha256:caffe0a9277daeccc4d1de5c9b55ebba0901b57c2f713ec9c876b0d4ec064f61
-# created: 2023-11-08T19:46:45.022803742Z
+ digest: sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5
+# created: 2023-11-23T18:17:28.105124211Z
diff --git a/.kokoro/presubmit/prerelease-deps-3.11.cfg b/.kokoro/presubmit/prerelease-deps-3.12.cfg
similarity index 77%
rename from .kokoro/presubmit/prerelease-deps-3.11.cfg
rename to .kokoro/presubmit/prerelease-deps-3.12.cfg
index 1e19f1239..ece962a17 100644
--- a/.kokoro/presubmit/prerelease-deps-3.11.cfg
+++ b/.kokoro/presubmit/prerelease-deps-3.12.cfg
@@ -3,5 +3,5 @@
# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
- value: "prerelease_deps-3.11"
+ value: "prerelease_deps-3.12"
}
diff --git a/.kokoro/presubmit/snippets-3.11.cfg b/.kokoro/presubmit/snippets-3.12.cfg
similarity index 81%
rename from .kokoro/presubmit/snippets-3.11.cfg
rename to .kokoro/presubmit/snippets-3.12.cfg
index 74af6dd07..1381e8323 100644
--- a/.kokoro/presubmit/snippets-3.11.cfg
+++ b/.kokoro/presubmit/snippets-3.12.cfg
@@ -3,5 +3,5 @@
# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
- value: "snippets-3.11"
+ value: "snippets-3.12"
}
diff --git a/.kokoro/presubmit/system-3.11.cfg b/.kokoro/presubmit/system-3.12.cfg
similarity index 82%
rename from .kokoro/presubmit/system-3.11.cfg
rename to .kokoro/presubmit/system-3.12.cfg
index 5ff31a603..789455bd6 100644
--- a/.kokoro/presubmit/system-3.11.cfg
+++ b/.kokoro/presubmit/system-3.12.cfg
@@ -3,5 +3,5 @@
# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
- value: "system-3.11"
+ value: "system-3.12"
}
diff --git a/.kokoro/samples/python3.12/common.cfg b/.kokoro/samples/python3.12/common.cfg
new file mode 100644
index 000000000..6eb699edd
--- /dev/null
+++ b/.kokoro/samples/python3.12/common.cfg
@@ -0,0 +1,40 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Build logs will be here
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.xml"
+ }
+}
+
+# Specify which tests to run
+env_vars: {
+ key: "RUN_TESTS_SESSION"
+ value: "py-3.12"
+}
+
+# Declare build specific Cloud project.
+env_vars: {
+ key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
+ value: "python-docs-samples-tests-312"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-bigquery/.kokoro/test-samples.sh"
+}
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
+}
+
+# Download secrets for samples
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
+
+# Download trampoline resources.
+gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
+
+# Use the trampoline script to run in docker.
+build_file: "python-bigquery/.kokoro/trampoline_v2.sh"
\ No newline at end of file
diff --git a/.kokoro/samples/python3.12/continuous.cfg b/.kokoro/samples/python3.12/continuous.cfg
new file mode 100644
index 000000000..a1c8d9759
--- /dev/null
+++ b/.kokoro/samples/python3.12/continuous.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/.kokoro/samples/python3.12/periodic-head.cfg b/.kokoro/samples/python3.12/periodic-head.cfg
new file mode 100644
index 000000000..5aa01bab5
--- /dev/null
+++ b/.kokoro/samples/python3.12/periodic-head.cfg
@@ -0,0 +1,11 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
+
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/python-bigquery/.kokoro/test-samples-against-head.sh"
+}
diff --git a/.kokoro/samples/python3.12/periodic.cfg b/.kokoro/samples/python3.12/periodic.cfg
new file mode 100644
index 000000000..71cd1e597
--- /dev/null
+++ b/.kokoro/samples/python3.12/periodic.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "False"
+}
diff --git a/.kokoro/samples/python3.12/presubmit.cfg b/.kokoro/samples/python3.12/presubmit.cfg
new file mode 100644
index 000000000..a1c8d9759
--- /dev/null
+++ b/.kokoro/samples/python3.12/presubmit.cfg
@@ -0,0 +1,6 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+env_vars: {
+ key: "INSTALL_LIBRARY_FROM_SOURCE"
+ value: "True"
+}
\ No newline at end of file
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 5dc30a1f8..7be61e6b6 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -22,7 +22,7 @@ In order to add a feature:
documentation.
- The feature must work fully on the following CPython versions:
- 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows.
+ 3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests.
- To run a single unit test::
- $ nox -s unit-3.11 -- -k
+ $ nox -s unit-3.12 -- -k
.. note::
@@ -226,12 +226,14 @@ We support:
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
+- `Python 3.12`_
.. _Python 3.7: https://docs.python.org/3.7/
.. _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/
Supported versions can be found in our ``noxfile.py`` `config`_.
diff --git a/noxfile.py b/noxfile.py
index 246952728..ab7803040 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -37,8 +37,8 @@
)
DEFAULT_PYTHON_VERSION = "3.8"
-SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.11"]
-UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.11", "3.12"]
+UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
@@ -81,7 +81,7 @@ def default(session, install_extras=True):
constraints_path,
)
- if install_extras and session.python == "3.11":
+ if install_extras and session.python in ["3.11", "3.12"]:
install_target = ".[bqstorage,ipywidgets,pandas,tqdm,opentelemetry]"
elif install_extras:
install_target = ".[all]"
@@ -187,7 +187,7 @@ def system(session):
# Data Catalog needed for the column ACL test with a real Policy Tag.
session.install("google-cloud-datacatalog", "-c", constraints_path)
- if session.python == "3.11":
+ if session.python in ["3.11", "3.12"]:
extras = "[bqstorage,ipywidgets,pandas,tqdm,opentelemetry]"
else:
extras = "[all]"
@@ -251,7 +251,7 @@ def snippets(session):
session.install("google-cloud-storage", "-c", constraints_path)
session.install("grpcio", "-c", constraints_path)
- if session.python == "3.11":
+ if session.python in ["3.11", "3.12"]:
extras = "[bqstorage,ipywidgets,pandas,tqdm,opentelemetry]"
else:
extras = "[all]"
diff --git a/samples/desktopapp/noxfile.py b/samples/desktopapp/noxfile.py
index 1224cbe21..3b7135946 100644
--- a/samples/desktopapp/noxfile.py
+++ b/samples/desktopapp/noxfile.py
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
# DO NOT EDIT - automatically generated.
# All versions used to test samples.
-ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
diff --git a/samples/geography/noxfile.py b/samples/geography/noxfile.py
index 1224cbe21..3b7135946 100644
--- a/samples/geography/noxfile.py
+++ b/samples/geography/noxfile.py
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
# DO NOT EDIT - automatically generated.
# All versions used to test samples.
-ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
diff --git a/samples/geography/requirements.txt b/samples/geography/requirements.txt
index 867f44b35..d6cea7ec5 100644
--- a/samples/geography/requirements.txt
+++ b/samples/geography/requirements.txt
@@ -7,10 +7,11 @@ click-plugins==1.1.1
cligj==0.7.2
dataclasses==0.8; python_version < '3.7'
db-dtypes==1.1.1
-Fiona==1.9.4.post1
-geojson==3.0.1
+Fiona==1.9.5
+geojson==3.1.0
geopandas===0.10.2; python_version == '3.7'
-geopandas==0.13.2; python_version >= '3.8'
+geopandas==0.13.2; python_version == '3.8'
+geopandas==0.14.1; python_version >= '3.9'
google-api-core==2.11.1
google-auth==2.22.0
google-cloud-bigquery==3.11.4
@@ -19,9 +20,10 @@ google-cloud-core==2.3.3
google-crc32c==1.5.0
google-resumable-media==2.5.0
googleapis-common-protos==1.60.0
-grpcio==1.57.0
+grpcio==1.59.0
idna==3.4
-libcst==1.0.1
+libcst==1.0.1; python_version == '3.7'
+libcst==1.1.0; python_version >= '3.8'
munch==4.0.0
mypy-extensions==1.0.0
packaging==23.1
@@ -39,7 +41,7 @@ pytz==2023.3
PyYAML==6.0.1
requests==2.31.0
rsa==4.9
-Shapely==2.0.1
+Shapely==2.0.2
six==1.16.0
typing-extensions==4.7.1
typing-inspect==0.9.0
diff --git a/samples/magics/noxfile.py b/samples/magics/noxfile.py
index 1224cbe21..3b7135946 100644
--- a/samples/magics/noxfile.py
+++ b/samples/magics/noxfile.py
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
# DO NOT EDIT - automatically generated.
# All versions used to test samples.
-ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
diff --git a/samples/notebooks/noxfile.py b/samples/notebooks/noxfile.py
index 1224cbe21..3b7135946 100644
--- a/samples/notebooks/noxfile.py
+++ b/samples/notebooks/noxfile.py
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
# DO NOT EDIT - automatically generated.
# All versions used to test samples.
-ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py
index 1224cbe21..3b7135946 100644
--- a/samples/snippets/noxfile.py
+++ b/samples/snippets/noxfile.py
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
# DO NOT EDIT - automatically generated.
# All versions used to test samples.
-ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
+ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
diff --git a/setup.py b/setup.py
index f21bb586d..9fbc91ecb 100644
--- a/setup.py
+++ b/setup.py
@@ -133,6 +133,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Topic :: Internet",
],
diff --git a/testing/constraints-3.12.txt b/testing/constraints-3.12.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py
index 949c1993b..7c3438567 100644
--- a/tests/unit/test_query.py
+++ b/tests/unit/test_query.py
@@ -1281,7 +1281,6 @@ def test___repr__(self):
field1 = self._make_one("test", _make_subparam("field1", "STRING", "hello"))
got = repr(field1)
self.assertIn("StructQueryParameter", got)
- self.assertIn("'field1', 'STRING'", got)
self.assertIn("'field1': 'hello'", got)