Skip to content

Build the docs on Python 3.12 and check them on every PR - #589

Open
tonylampada wants to merge 1 commit into
mainfrom
tony/fix-docs-build
Open

tonylampada wants to merge 1 commit into
mainfrom
tony/fix-docs-build

Conversation

@tonylampada

@tonylampada tonylampada commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The reference site at https://roboflow.github.io/roboflow-python still shows 1.7.1, so Project.move_images_to_batch and everything else from 1.7.2 to 1.7.4 is missing. Its docs job in publish.yml has failed on every release since v1.7.2 (v1.7.4 run). pymdown-extensions 12.2 changed Highlight.__init__, and mkdocstrings fixed that in 1.0.7 (mkdocstrings#829) but dropped Python 3.10 in the same release. The job runs 3.10, so pip pairs mkdocstrings 1.0.6 with pymdown-extensions 12.3 and mkdocs build raises a TypeError. No PR builds the docs, so three releases shipped with it broken.

What changes:

  • The docs build on Python 3.12 with the newest tools. Nothing is pinned.
  • Every PR runs the same build (docs job in test.yml).
  • You can run publish.yml by hand from main. A manual run deploys the docs and skips PyPI.
  • Nav: Quickstart is gone (no such page; Home has that section). Changelog opens CHANGELOG.md on GitHub. Both were 404s.

after-project

Tested

  • Base fails as in CI: 3.10, the job's commands, mkdocs build on 243b562
  • Cause isolated: the same env with only pymdown-extensions at 12.1 builds
  • Branch builds on 3.12 with no nav warnings, locally on 531617e and in this PR's docs job
  • Project page shows move_images_to_batch, and core/dataset renders (the live site, then the local build)
  • Not run: a manual publish.yml run. GitHub allows one only once the trigger is on main.
  • Not run: actionlint, which couldn't be installed here. Both workflows parse.

before-project
after-project-same
after-dataset

Evidence

Red, base 243b562 (= v1.7.4), Python 3.10.16, fresh venv, the job's commands:

python -m pip install --upgrade pip
pip install mkdocs-material mkdocstrings mkdocstrings[python]
pip install ".[dev]"
mkdocs build
Successfully installed ... mkdocs-1.6.1 ... mkdocs-material-9.7.7 ... mkdocstrings-1.0.6 mkdocstrings-python-2.0.9 ... pymdown-extensions-12.3 ...
INFO    -  Cleaning site directory
WARNING -  A reference to 'quickstart.md' is included in the 'nav' configuration, which is not found in the documentation files.
WARNING -  A reference to 'changelog.md' is included in the 'nav' configuration, which is not found in the documentation files.
ERROR   -  Error reading page 'core/dataset.md': Highlight.__init__() missing 1 required positional argument: 'md'
Traceback (most recent call last):
  ...
  File ".../mkdocstrings/_internal/handlers/rendering.py", line 85, in __init__
    super().__init__(**{name: opt for name, opt in config.items() if name in self._highlight_config_keys})
TypeError: Highlight.__init__() missing 1 required positional argument: 'md'
exit=1

The installed set matches the v1.7.4 run. The last green deploy (v1.7.1, run 37946668852) had pymdown-extensions 12.1 and the same mkdocstrings 1.0.6.

Isolation, same 3.10 env: pip install "pymdown-extensions==12.1" && mkdocs build gives exit=0.

PyPI: pymdown-extensions 12.2 was published 2026-10-10 13:01 UTC. mkdocstrings 1.0.7 followed at 13:50 with requires_python >=3.11, as did mkdocstrings-python 2.0.10+ and mkdocs-material 9.8+. mkdocs-material requires mkdocs<2.

Green, branch 531617e, Python 3.12.9, fresh venv, same commands:

Successfully installed ... mkdocs-1.6.1 ... mkdocs-material-9.8.2 ... mkdocstrings-1.0.8 mkdocstrings-python-2.0.11 pymdown-extensions-13.1.2 ...
INFO    -  Cleaning site directory
INFO    -  Documentation built in 1.69 seconds
exit=0

I built with -d <scratch dir>, and the output directory line is cut. 56 docstring warnings remain (51 griffe, 5 autorefs), so --strict would fail. The CI docs job got the same versions on CPython 3.12.16.

The live site is missing the method: curl -fsS https://roboflow.github.io/roboflow-python/core/project/ | grep -c move_images_to_batch prints 0. Screenshots are 1280×800. "Before" is the live site, since the base build has no page to show. The live header badge reads v1.7.4 because Material reads the latest release from GitHub in the browser, but the content is 1.7.1.

Deploy

After merge, and before anything else merges, Tony runs gh workflow run publish.yml -R roboflow/roboflow-python --ref main. Only deploy-docs runs, and it publishes main, which is v1.7.4 plus this PR. A run from another branch skips every job. Releases deploy after PyPI as before. No CHANGELOG entry, since the package doesn't change.

Reviewer guide

None: small fix

🤖 Generated with Claude Code

The docs job has failed since v1.7.2: pymdown-extensions 12.2 changed
Highlight.__init__, mkdocstrings fixed it in 1.0.7 and dropped Python
3.10 in the same release, so the job's Python 3.10 resolves the old
mkdocstrings with the new pymdown-extensions. Build on 3.12 with the
newest tools instead; nothing is pinned.

- test.yml: a docs job runs the same build on every PR.
- publish.yml: workflow_dispatch from main deploys the docs alone; the
  PyPI jobs run only on a release.
- mkdocs.yml: drop the Quickstart nav entry (no such page; Home has the
  section) and point Changelog at CHANGELOG.md on GitHub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tonylampada

Copy link
Copy Markdown
Collaborator Author

Trail

Plan. No plan block or PR draft came with the brief. I wrote both from it. The plan block is folded below, and the PR draft was this PR's first body. There was no plan gate.

Changed from the brief while building

  • --strict stayed off. After the nav fix, 56 docstring warnings remain (51 griffe, 5 autorefs). Fixing them is docstring work across roboflow/, which is out of scope here.
  • Nav: Quickstart was removed because the page never existed (it has been in the nav since 2023-09-01), and Home has a Quickstart section. Changelog now points at CHANGELOG.md on GitHub. Both were 404s on the live site.
  • The manual trigger is guarded: build runs only on release, so a manual run never publishes to PyPI, and deploy-docs runs on a manual run only from main.
  • CONTRIBUTING.md and CLAUDE.md now say the docs need Python 3.11+. Their install line fails the same way on 3.10.
  • No CHANGELOG entry, because nothing in the package changes.
  • The PR check repeats the deploy job's install lines instead of sharing them. A shared reusable workflow would be a bigger diff. The Python version carries a "keep in step" comment.

Diff gate: 1 round, go, no findings. One Note, taken as already out of scope: the docstring and cross-reference warnings remain, and the build passes without strict mode.

Pruned: nothing. No tests were added, since this PR changes only CI and config.

Bot review: none for this repo.

Plan block

Plan block: fix the SDK docs build (roboflow-python)

outcome: the reference site (roboflow.github.io/roboflow-python, built by .github/workflows/publish.yml job deploy-docs) builds again, a PR shows a broken docs build before release, and the site can be republished for 1.7.4 without a new release.

cause (confirmed): pymdown-extensions 12.2 (2026-10-10) made pymdownx.highlight.Highlight.__init__ take md; mkdocstrings fixed it in 1.0.7 (issue mkdocstrings#829) and in the same release dropped Python 3.10. The job runs Python 3.10, so pip pairs mkdocstrings 1.0.6 with pymdown-extensions 12.3 -> TypeError: Highlight.__init__() missing 1 required positional argument: 'md'. Swapping only pymdown-extensions back to 12.1 on 3.10 builds.

touches:

  • .github/workflows/publish.yml: deploy-docs on Python 3.12 (newest tools, nothing pinned); add workflow_dispatch; build runs only on release (so a manual run never publishes to PyPI; build-slim follows build); deploy-docs runs after a successful build on release, or on a manual run from main alone.
  • .github/workflows/test.yml: new docs job, Python 3.12, same install lines as deploy-docs, mkdocs build (not --strict: ~57 griffe/autorefs docstring warnings remain).
  • mkdocs.yml: nav Quickstart: quickstart.md removed (page never existed; Home has a Quickstart section); Changelog points at CHANGELOG.md on GitHub (changelog.md never existed). Both were 404 links on the live site.
  • CONTRIBUTING.md, CLAUDE.md: the docs install line says Python 3.11 or newer.

calls:

  • release published -> build, build-slim, deploy-docs as before (deploy after build succeeds), docs now on 3.12.
  • workflow_dispatch on main -> build/build-slim skipped, deploy-docs builds and deploys main's docs.
  • workflow_dispatch on another ref -> every job skipped.

tests (no unit tests: CI/config only):

  • red: base 243b562, Python 3.10, the job's exact install lines, mkdocs build -> exit 1 with the CI traceback.
  • green: branch, Python 3.12, same lines -> exit 0; nav warnings gone.
  • PR CI: new docs job green on the PR.
  • screen: locally built Project page shows move_images_to_batch; core/dataset renders.

not here: --strict (needs docstring fixes), Node 20 action bumps, MkDocs 2.0 migration (mkdocs-material caps mkdocs<2), sharing install lines between the two workflows.

Diff gate, round 1 (local paths replaced)

Diff gate review

Base: 243b562
Head: 531617e72137084fb916c431ceeff7781184b8fb

Findings

None. Reviewed correctness, architecture, errors, naming, size, tests, and scope against the supplied plan and repository rules. All five changed files are covered by the plan.

The release-only guard preserves package publishing on releases. build-slim retains its successful-build dependency. The docs condition explicitly uses a status function, allowing it to run when build is skipped for a manual main run; manual runs on other refs cannot satisfy either branch. Release build failures and cancellations prevent docs deployment. The PR docs job uses the same Python version, install commands, and build command as deployment.

Validation

  • Independently ran the current worktree's docs build using the builder's prepared <the builder's Python 3.12 venv>/bin/python -m mkdocs build --site-dir <reviewer scratch>/site, with bytecode writing disabled. Exit 0; documentation built in 1.70 seconds. Log: <reviewer scratch>/build.log.
  • Asserted generated HTML contains the Project.move_images_to_batch and Dataset reference anchors and the GitHub changelog URL. Passed. Neither removed nav filename appears in the build log.
  • Inspected supplied red-build.log: the Python 3.10 build fails with the reported missing md argument, exit 1. Inspected supplied green build and PR docs CI logs; these support successful builds. These historical runs were not independently repeated.
  • Workflow event/dependency paths reviewed statically. Actual release/manual deployment not run; no publishing action performed.
  • SDK tests/lint not run: no SDK implementation changed. No fresh dependency installation performed; the independent build reused the prepared Python 3.12 environment. Visual screenshot inspection not run; generated HTML checked directly.

Notes

  • Existing docstring/cross-reference warnings remain, as explicitly deferred by the plan; the build succeeds without strict mode.

verdict: go

@tonylampada
tonylampada marked this pull request as ready for review November 25, 2026 12:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant