diff --git a/packages/db-dtypes/docs/conf.py b/packages/db-dtypes/docs/conf.py index 672dafff8ba7..2c755cbc5cbe 100644 --- a/packages/db-dtypes/docs/conf.py +++ b/packages/db-dtypes/docs/conf.py @@ -359,7 +359,6 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), "google.api_core": ( "https://googleapis.dev/python/google-api-core/latest/", @@ -371,6 +370,21 @@ "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), } +# Check reachability of the Python standard library inventory before attaching it. +# Because Sphinx is run with `-W` (warnings as errors) in CI, an external network +# failure or upstream outage on docs.python.org would otherwise treat the missing +# inventory as a fatal error and fail the build. +try: + import urllib.request + + with urllib.request.urlopen("https://docs.python.org/3/objects.inv", timeout=2): + intersphinx_mapping["python"] = ( + "https://python.readthedocs.org/en/latest/", + None, + ) +except Exception: + pass + # Napoleon settings napoleon_google_docstring = True diff --git a/packages/db-dtypes/testing/constraints-3.14.txt b/packages/db-dtypes/testing/constraints-3.14.txt index e69de29bb2d1..72e1e5759b6f 100644 --- a/packages/db-dtypes/testing/constraints-3.14.txt +++ b/packages/db-dtypes/testing/constraints-3.14.txt @@ -0,0 +1,10 @@ +# When testing with `pandas >= 3.1.0` (currently in pre-release as `pandas==3.1.0rc0`), +# the `db-dtypes` compliance test suite (`tests/compliance`) fails due to upstream +# changes in pandas internal utilities and ExtensionArray interface contracts. +# To prevent presubmit PR CI from failing unexpectedly on developer branches, a +# temporary ceiling constraint (`pandas < 3.1.0dev0`) was added. +# +# Forward-looking tests against upcoming, unreleased versions of pandas and other +# dependencies continue to run in our dedicated pre-release test suite. + +pandas < 3.1.0dev0 diff --git a/packages/db-dtypes/tests/unit/test_dtypes.py b/packages/db-dtypes/tests/unit/test_dtypes.py index b4039c595828..c3283929101a 100644 --- a/packages/db-dtypes/tests/unit/test_dtypes.py +++ b/packages/db-dtypes/tests/unit/test_dtypes.py @@ -534,7 +534,15 @@ def exercise_any(): try: return a.any() except TypeError as e: - if "does not support operation" in str(e) or "not supported" in str(e): + # Truth reduction ('any'/'all') is disallowed on datetime64 arrays (pandas GH#34479). + # Known messages across pandas versions: + # - pandas < 3.0: "datetime64 type does not support operation 'any'" + # - pandas >= 3.0: "'any' with datetime64 dtypes is not supported" + # - test mock: "does not support operation" + msg = str(e) + if "does not support operation" in msg or ( + "datetime64" in msg and "is not supported" in msg + ): return raise e @@ -571,7 +579,15 @@ def exercise_all(): try: return a.all() except TypeError as e: - if "does not support operation" in str(e) or "not supported" in str(e): + # Truth reduction ('any'/'all') is disallowed on datetime64 arrays (pandas GH#34479). + # Known messages across pandas versions: + # - pandas < 3.0: "datetime64 type does not support operation 'all'" + # - pandas >= 3.0: "'all' with datetime64 dtypes is not supported" + # - test mock: "does not support operation" + msg = str(e) + if "does not support operation" in msg or ( + "datetime64" in msg and "is not supported" in msg + ): return raise e diff --git a/packages/gcp-sphinx-docfx-yaml/noxfile.py b/packages/gcp-sphinx-docfx-yaml/noxfile.py index c07b64581285..59a5741a796c 100644 --- a/packages/gcp-sphinx-docfx-yaml/noxfile.py +++ b/packages/gcp-sphinx-docfx-yaml/noxfile.py @@ -171,7 +171,9 @@ def lint_setup_py(session): session.run("flake8", "setup.py") -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) +# Use virtualenv backend to prevent modern uv build isolation from failing on +# legacy sdist dependencies (unify/untokenize) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS, venv_backend="virtualenv") def unit(session): """Run unit tests.""" # Re-enable 3.11, 3.12, and 3.13 after environment verification.