From f03827ac5968d02693f5f1aeb4c9318ca2b662d8 Mon Sep 17 00:00:00 2001 From: Inessa Pawson Date: Sat, 3 Oct 2026 12:06:15 -0400 Subject: [PATCH] feat(CI/nox): treat Sphinx warnings as errors in docs-test --- maintain-automate/dev-installs.md | 2 +- noxfile.py | 5 +++++ .../python-package-distribution-files-sdist-wheel.md | 2 +- tests/run-tests.md | 2 +- tutorials/pyproject-toml.md | 6 +++--- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/maintain-automate/dev-installs.md b/maintain-automate/dev-installs.md index f4d9e6e74..545de8b14 100644 --- a/maintain-automate/dev-installs.md +++ b/maintain-automate/dev-installs.md @@ -1,4 +1,4 @@ -## Installing your own code +# Installing your own code You have a conda environment. It works. Maybe it has packages that were hard to install, like GDAL, HDF5, or other compiled scientific dependencies. diff --git a/noxfile.py b/noxfile.py index 56d1dcbea..41a727c18 100644 --- a/noxfile.py +++ b/noxfile.py @@ -45,6 +45,10 @@ # Sphinx parameters used to test the build of the guide TEST_PARAMETERS = ["--keep-going", "-E", "-a"] +# Fail the build on warnings (English build in CI). +# Not yet applied to translations. See follow-up issue. +STRICT_PARAMETERS = ["--fail-on-warning"] + # Sphinx parameters to generate translation templates TRANSLATION_TEMPLATE_PARAMETERS = ["-b", "gettext"] @@ -112,6 +116,7 @@ def docs_test(session): SPHINX_BUILD, *BUILD_PARAMETERS, *TEST_PARAMETERS, + *STRICT_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs, diff --git a/package-structure-code/python-package-distribution-files-sdist-wheel.md b/package-structure-code/python-package-distribution-files-sdist-wheel.md index c015d1c1e..6469935fd 100644 --- a/package-structure-code/python-package-distribution-files-sdist-wheel.md +++ b/package-structure-code/python-package-distribution-files-sdist-wheel.md @@ -47,7 +47,7 @@ The metadata that both build tools and PyPI uses to describe and understand your :::{literalinclude} ../examples/pure-hatch/pyproject.toml :language: toml :start-at: dependencies = [ -:end-before: [development-group] +:end-before: [dependency-groups] ::: 2. When the build tool creates your package distribution file (the file that you publish on PyPI), it also creates a METADATA file which PyPI can read and use to help users find your package. For example: diff --git a/tests/run-tests.md b/tests/run-tests.md index 46e557413..efa6bb9cc 100644 --- a/tests/run-tests.md +++ b/tests/run-tests.md @@ -190,7 +190,7 @@ The additional tools or options to run with the tests is specified under `[tool. :::{literalinclude} ../examples/pure-hatch/pyproject.toml :language: toml -:start-at: [development-group] +:start-at: [dependency-groups] :end-before: lint ::: diff --git a/tutorials/pyproject-toml.md b/tutorials/pyproject-toml.md index 9e708b387..cb6b3e4b5 100644 --- a/tutorials/pyproject-toml.md +++ b/tutorials/pyproject-toml.md @@ -385,7 +385,7 @@ dependencies = [ Your `pyproject.toml` file will now look like this: -{emphasize-lines="24"} +{emphasize-lines="23"} ```toml [build-system] requires = ["hatchling"] @@ -458,7 +458,7 @@ The classifier key should look something like the example below. A few notes: - Your classifier values might be different depending upon your intended audience, development status of your package and the Python versions that you support - You can add as many classifiers as you wish as long as you use the [designated PyPI classifier values](https://PyPI.org/classifiers/). -{emphasize-lines="26-33"} +{emphasize-lines="25-32"} ```toml [build-system] requires = ["hatchling"] @@ -506,7 +506,7 @@ Finally, add the project.urls table to your pyproject.toml file. - **Bug reports:** a link to your issues/discussions or wherever you want users to report bugs. - **Source:** the GitHub / GitLab link for your project. -{emphasize-lines="35-38"} +{emphasize-lines="34-37"} ```toml [build-system] requires = ["hatchling"]