Skip to content

Fix the broken docs tox environment - #2689

Open
chala2001 wants to merge 1 commit into
kubernetes-client:masterfrom
chala2001:tox-docs-env
Open

Fix the broken docs tox environment#2689
chala2001 wants to merge 1 commit into
kubernetes-client:masterfrom
chala2001:tox-docs-env

Conversation

@chala2001

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

tox -e docs cannot run. It calls python setup.py build_sphinx, and that command
came from sphinx.setup_command, which Sphinx removed in 7.0. test-requirements.txt
pins sphinx>=8.1.3, so on a current checkout:

$ python setup.py build_sphinx
error: invalid command 'build_sphinx'

Fixing the command alone is not enough. doc/source/conf.py imports recommonmark
and lists it as an extension, and recommonmark appears in none of the four
requirements files the tox env already installs - it is only in
doc/requirements-docs.txt, which the env never pulls in. So the environment would
still have failed while loading conf.py.

This PR points the env at the build doc/README.md documents (make html, which is
sphinx-apidoc then sphinx-build) and adds doc/requirements-docs.txt to its deps.
After the change:

docs: OK (13.89 seconds)
congratulations :)

Two related bits of tidying that belong to the same story:

  • setup.cfg contained [build_sphinx] and [upload_sphinx] and nothing else. Both
    are settings for the command Sphinx removed, so the file goes with them. The only
    other setup.cfg references in the tree are to the generated kubernetes/setup.cfg,
    which is a flake8 config and is untouched.
  • envlist still named py3{6,7,8,9}. setup.py sets python_requires='>=3.10' and
    CI tests 3.10 through 3.14, so all four named environments are below the supported
    floor.

Which issue(s) this PR fixes:

No open issue - I hit this while looking at the packaging config in #2687 and #2688.
Happy to file one first if you would prefer that.

Special notes for your reviewer:

I verified the docs toolchain itself is healthy under Sphinx 8.1.3 - sphinx-build
loads conf.py with recommonmark and sphinx_markdown_tables and reports
build succeeded, and sphinx-apidoc generates all 1,810 module pages. I did not
run the full 1,800-module render to completion; that build is memory-hungry and my
machine ran out of RAM part way through writing HTML. Everything this PR claims is
about the tox environment resolving and invoking the right command, which is what
the docs: OK above shows.

Independent of #2688 - different branch, no shared files.

Does this PR introduce a user-facing change?

NONE

tox -e docs runs "python setup.py build_sphinx", a command that came from
sphinx.setup_command. Sphinx removed it in 7.0 and test-requirements.txt pins
sphinx>=8.1.3, so the environment fails with:

    error: invalid command 'build_sphinx'

Runs the build documented in doc/README.md instead, and pulls in
doc/requirements-docs.txt. doc/source/conf.py imports recommonmark, which none
of the four requirements files tox already installs provides, so the
environment could not have worked even with the command fixed.

setup.cfg held only [build_sphinx] and [upload_sphinx], both settings for that
removed command, so it goes with them.

Also refreshes envlist, which still named py36 through py39. setup.py has
required 3.10 for a while now, and CI tests 3.10 through 3.14.
@kubernetes-prow kubernetes-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 27, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog August 27, 2026 19:09
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chala2001
Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant