close
Skip to content

Add sphinx-airflow-theme as uv workspace member#65840

Draft
srchilukoori wants to merge 1 commit intoapache:mainfrom
srchilukoori:feature/sphinx-theme-workspace
Draft

Add sphinx-airflow-theme as uv workspace member#65840
srchilukoori wants to merge 1 commit intoapache:mainfrom
srchilukoori:feature/sphinx-theme-workspace

Conversation

@srchilukoori
Copy link
Copy Markdown
Contributor

@srchilukoori srchilukoori commented Apr 25, 2026

Summary

  • Vendors sphinx_airflow_theme (v0.3.9) templates from apache/airflow-site into docs-theme/ as a uv workspace member
  • Replaces the remote .whl URL dependency with a local workspace dependency
  • Static build artifacts (_gen/ — minified CSS/JS/fonts) are not committed to git; a fetch script extracts them from the published wheel on demand

Closes: #45576

Changes

  • docs-theme/: Vendored theme source (templates, config) from apache/airflow-site_gen/ is gitignored
  • scripts/ci/fetch_theme_assets.py: Idempotent script that downloads the published wheel from airflow.apache.org and extracts _gen/ into docs-theme/sphinx_airflow_theme/static/. Version-stamped to skip redundant downloads
  • docs-theme/sphinx_airflow_theme/__init__.py: Added guard that raises FileNotFoundError with clear instructions if _gen/ is missing. Fixed pre-existing bug where "__version__" was returned as a literal string instead of the version variable
  • pyproject.toml: Added docs-theme to [tool.uv.workspace] members and sphinx-airflow-theme to [tool.uv.sources]
  • devel-common/pyproject.toml: Changed sphinx-airflow-theme from .whl URL to standard version specifier (>=0.3.9)
  • Dockerfile.ci: Added RUN python fetch_theme_assets.py so CI images have _gen/ assets — required for task-sdk docs inventory tests that run sphinx-build independently of breeze build-docs
  • dev/breeze/src/airflow_breeze/commands/developer_commands.py: Auto-fetches theme assets before build-docs if _gen/ is missing
  • dev/breeze/src/airflow_breeze/utils/docker_command_utils.py: Added docs-theme to VOLUMES_FOR_SELECTED_MOUNTS
  • scripts/ci/prek/upgrade_important_versions.py: Restored theme version tracking — now updates __init__.py version instead of the old wheel URL pattern
  • .pre-commit-config.yaml: Removed _gen/ exclusions (no longer tracked in git)
  • selective_checks.py: Removed redundant ^docs-theme pattern (already matched by ^docs)
  • dev/breeze/tests/test_theme_workspace.py: Tests verifying workspace wiring, gitignore, and fetch script presence

Design decisions

  • Why not commit _gen/? It's 1.1MB of minified CSS, vendored JS (3 jQuery versions, 2 Popper versions), and binary fonts — 92% of the theme by size. Keeping build artifacts out of git avoids permanent repo bloat.
  • Why fetch from the wheel? The wheel URL on airflow.apache.org is the same source the current dependency already uses. No new infrastructure required.
  • Why a guard in __init__.py? Without _gen/, Sphinx fails with cryptic errors. The guard gives a one-line fix instruction.
  • Why fetch in Dockerfile.ci? Task-SDK tests run sphinx-build to verify docs inventory matches the public API. This runs inside the CI image, not via breeze build-docs, so the image itself needs the assets.

Motivation

As described in #45576, modifying the Sphinx docs theme currently requires building and publishing a .whl to airflow.apache.org before changes can be tested against Airflow docs. Adding the theme as a uv workspace member means uv sync resolves it from the local docs-theme/ directory. Editing a template and rebuilding docs immediately reflects the change.

Was generative AI tooling used to co-author this PR?

  • Yes

@boring-cyborg boring-cyborg Bot added area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels Apr 25, 2026
@srchilukoori srchilukoori reopened this Apr 26, 2026
@srchilukoori srchilukoori force-pushed the feature/sphinx-theme-workspace branch 2 times, most recently from 9cc9bb4 to 6e4caa7 Compare April 26, 2026 01:31
@srchilukoori srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 6e4caa7 to 02b9bc6 Compare April 26, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to mount airflow-site/sphinx_airflow_theme when running CI locally

1 participant