Skip to content

Replace vendored sphinx-tabs in envoy.docs.sphinx_runner with upstream PyPI dependency#4433

Closed
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-vendored-sphinx-tabs
Closed

Replace vendored sphinx-tabs in envoy.docs.sphinx_runner with upstream PyPI dependency#4433
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-vendored-sphinx-tabs

Conversation

Copilot AI commented May 11, 2026

Copy link
Copy Markdown
Contributor

envoy.docs.sphinx_runner was still shipping a vendored sphinx-tabs (v3.4.1) that existed to work around an upstream docutils pin. That upstream issue has long been resolved, so this change removes the vendored copy and switches the package to upstream sphinx-tabs (>=3.5.0).

  • Dependency wiring (sphinx_runner)

    • Updated /py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/BUILD:
      • removed ./sphinx_tabs
      • added //py/deps:reqs#sphinx-tabs (grouped with other Sphinx deps)
  • Remove vendored extension

    • Deleted /py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/ entirely:
      • Python module, BUILD target, README, and static assets
  • Promote to canonical Python deps

    • Added sphinx-tabs>=3.5.0 to /py/deps/requirements.in
    • Regenerated dependency artifacts so the upstream package is resolved in project lock/requirements outputs
  • Reference cleanup

    • Searched for internal references to vendored paths (envoy.docs.sphinx_runner.sphinx_tabs, from .sphinx_tabs, ./sphinx_tabs) and removed remaining usage by switching dependency ownership to the PyPI package
# py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/BUILD
dependencies=[
    "//py/deps:reqs#sphinx",
    "//py/deps:reqs#sphinx-copybutton",
    "//py/deps:reqs#sphinx-rtd-theme",
    "//py/deps:reqs#sphinx-tabs",
    "//py/deps:reqs#sphinxcontrib-jquery",
    ...
]
Original prompt

Background

The envoy.docs.sphinx_runner package contains a vendored copy of sphinx-tabs at version 3.4.1 under:

py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/

The vendored README explicitly documents why and when it can be removed:

Vendored from https://github.com/executablebooks/sphinx-tabs.

Can be removed when executablebooks/sphinx-tabs#171 is resolved.

Issue executablebooks/sphinx-tabs#171 (a strict docutils~=0.18.0 pin that conflicted with sphinx / sphinx_rtd_theme / doc8 etc.) was closed as completed on 2023-12-26 and the fix shipped in sphinx-tabs v3.4.5 (Jan 2024) via PR #186 "FIX: unpin docutils".

The latest upstream release at the time of writing is v3.5.0 (March 2026), which also includes Sphinx 8.1 / Docutils 0.22 compatibility fixes and a fix to drop usage of internal Sphinx API (PR #198 in v3.4.6). The vendored copy at 3.4.1 is missing ~4 years of upstream improvements.

Task

Remove the vendored sphinx-tabs and switch to the upstream PyPI package.

Changes required

  1. Delete the vendored directory (entire tree):

    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/__init__.py
    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/tabs.py
    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/README.md
    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/BUILD
    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/static/tabs.css
    • py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/sphinx_tabs/static/tabs.js
  2. Update py/envoy.docs.sphinx_runner/envoy/docs/sphinx_runner/BUILD:

    • Remove the "./sphinx_tabs" dependency.
    • Add "//py/deps:reqs#sphinx-tabs" in its place (alphabetically sorted alongside the other sphinx* reqs).

    Current relevant snippet:

    toolshed_library(
        "envoy.docs.sphinx_runner",
        dependencies=[
            ...
            "//py/deps:reqs#sphinx",
            "//py/deps:reqs#sphinx-copybutton",
            "//py/deps:reqs#sphinx-rtd-theme",
            "//py/deps:reqs#sphinxcontrib-jquery",
            "//py/deps:reqs#sphinxcontrib-httpdomain",
            "//py/deps:reqs#sphinxcontrib-serializinghtml",
            "//py/deps:reqs#sphinxext-rediraffe",
            "//py/deps:reqs#types-pygments",
            "./sphinx_tabs",
        ],
        ...
    )
  3. Add sphinx-tabs to the Python requirements in py/deps/ (or wherever the canonical requirements.in / requirements.txt lives for this workspace — match the pattern used by sphinx-copybutton, sphinx-rtd-theme, etc.). Use a sensible lower bound such as >=3.5.0 (this is the version that contains both the docutils fix and the Sphinx 8.1 / Docutils 0.22 compatibility fixes). Then regenerate any lock files using the standard process used in this repo.

  4. Search the codebase for any internal references to envoy.docs.sphinx_runner.sphinx_tabs (e.g. as a Sphinx extension entry, imports in runner.py, cmd.py, ext/*.py, or in tests under py/envoy.docs.sphinx_runner/) and update them to refer to the upstream sphinx_tabs extension instead. The upstream extension is registered as sphinx_tabs.tabs.

  5. Verify nothing else in the repo imports from the vendored path. A grep for sphinx_runner.sphinx_tabs, from .sphinx_tabs, and import sphinx_tabs should be clean (or only reference the upstream package after the switch).

Verification

  • Run the package's existing tests / lint targets in the toolshed repo (the standard bazel/Pants test invocation used by CI for py/envoy.docs.sphinx_runner).
  • Confirm sphinx-tabs resolves in the dependency lockfile alongside the existing sphinx, sphinx-rtd-theme, docutils, etc., with no version conflicts.

Notes

  • The vendored extension is, by all appearances, an unmodified copy of upstream v3.4.1 (the BUILD file disables flake8/mypy/docformatter, consistent with "do not touch vendored code"). No Envoy-specific patches need to be preserved.
  • Downstream consumers (e.g. envoyproxy/envoy docs/conf.py) may reference the extension by its current import path. That is out of scope for this PR — any required follow-up will be done in the consumer repo. Just make sure this PR cleanly publishes the package without the vendored module.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: its been brought to my attention that the py package envoy.docs.sphinx_runner package has a vendored sphinx-tabs

pretty sure there was a reason why this was vendored originally - not sure at all there is any reason to keep - other bot said they could not see one - but want to make sure

Assistant: Fo...

This pull request was created from Copilot chat.

@netlify

netlify Bot commented May 11, 2026

Copy link
Copy Markdown

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit c1ad964
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/6a017cba05ca3d0008b2c4de
😎 Deploy Preview https://deploy-preview-4433--nifty-bassi-e26446.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Remove vendored sphinx-tabs and update to v3.5.0 Replace vendored sphinx-tabs in envoy.docs.sphinx_runner with upstream PyPI dependency May 11, 2026
Copilot AI requested a review from phlax May 11, 2026 06:56
Copilot finished work on behalf of phlax May 11, 2026 06:56
@phlax phlax closed this May 11, 2026
@phlax phlax deleted the copilot/remove-vendored-sphinx-tabs branch May 11, 2026 10:55
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.

2 participants