Add sphinx-airflow-theme as uv workspace member#65840
Open
srchilukoori wants to merge 3 commits intoapache:mainfrom
Open
Add sphinx-airflow-theme as uv workspace member#65840srchilukoori wants to merge 3 commits intoapache:mainfrom
srchilukoori wants to merge 3 commits intoapache:mainfrom
Conversation
02b9bc6 to
4bacb0f
Compare
Member
|
How are you going to make sure it is going to be synchronized between |
potiuk
requested changes
Apr 26, 2026
Member
potiuk
left a comment
There was a problem hiding this comment.
Waiting for explantion of how the process shoudl work
srchilukoori
commented
Apr 26, 2026
| (AIRFLOW_ROOT_PATH / "dev" / "provider_db_inventory.py", False), | ||
| (AIRFLOW_ROOT_PATH / "dev" / "pyproject.toml", False), | ||
| (AIRFLOW_ROOT_PATH / "go-sdk" / ".pre-commit-config.yaml", False), | ||
| (AIRFLOW_ROOT_PATH / "docs-theme" / "sphinx_airflow_theme" / "__init__.py", False), |
Contributor
Author
There was a problem hiding this comment.
@potiuk this step pulls the latest theme files from the upstream airflow-site
4bacb0f to
7dc298f
Compare
8fa2a00 to
dd88bf6
Compare
dd88bf6 to
26ed34d
Compare
urlopen can fail transiently in CI (HTTP 401, timeouts, connection resets). Retry up to 3 times with exponential backoff (2s, 4s) before exiting with an error.
Contributor
Author
What changed: Before → AfterAsset Fetch PipelineCI Entry PointsKey decisions:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sphinx_airflow_theme(v0.3.9) templates fromapache/airflow-siteintodocs-theme/as a uv workspace member.whlURL dependency with a local workspace dependency_gen/— minified CSS/JS/fonts) are not committed to git; a fetch script extracts them from the published wheel on demandCloses: #45576
Changes
docs-theme/: Vendored theme source (templates, config) fromapache/airflow-site—_gen/is gitignoredscripts/ci/fetch_theme_assets.py: Idempotent script that downloads the published wheel fromairflow.apache.organd extracts all theme files (templates +_gen/) intodocs-theme/sphinx_airflow_theme/. Skips__init__.py(version-managed locally). Applies compliance patches post-extraction (license headers, inclusive language). Version-stamped to skip redundant downloadsdocs-theme/sphinx_airflow_theme/__init__.py: Added guard that raisesFileNotFoundErrorwith clear instructions if_gen/is missing. Fixed pre-existing bug where"__version__"was returned as a literal string instead of the version variablepyproject.toml: Addeddocs-themeto[tool.uv.workspace]members andsphinx-airflow-themeto[tool.uv.sources]devel-common/pyproject.toml: Changedsphinx-airflow-themefrom.whlURL to standard version specifier (>=0.3.9)Dockerfile.ci: AddedRUN python fetch_theme_assets.pyso CI images have_gen/for non-bind-mount scenarios (e.g.,--mount-sources=removewith--use-airflow-version).github/workflows/airflow-distributions-tests.yml: Added a host-sidepython scripts/ci/fetch_theme_assets.pystep beforebreeze testing— required because breeze's defaultMOUNT_SELECTEDbind-mounts hostdocs-theme/over the container path, which masks the image-baked_gen/. The fetch on the runner populates the bind-mounted directory.dev/breeze/src/airflow_breeze/commands/developer_commands.py: Auto-fetches theme assets beforebuild-docsif_gen/is missingdev/breeze/src/airflow_breeze/utils/docker_command_utils.py: Addeddocs-themetoVOLUMES_FOR_SELECTED_MOUNTSscripts/ci/prek/upgrade_important_versions.py: Restored theme version tracking — now updates__init__.pyversion 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-themepattern (already matched by^docs)dev/breeze/tests/test_theme_workspace.py: Tests verifying workspace wiring, gitignore, and fetch script presenceDesign decisions
_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.airflow.apache.orgis the same source the current dependency already uses. No new infrastructure required.__init__.py? Without_gen/, Sphinx fails with cryptic errors. The guard gives a one-line fix instruction.docs-theme/from host into the container at test time, masking anything baked into the image at that path. The workflow step ensures the host directory has_gen/for the bind-mount path; the Dockerfile RUN covers non-bind-mount paths (e.g.,--use-airflow-version).airflow-site?upgrade_important_versions.pydetects new theme releases and bumps__version__in__init__.py. When the version changes,fetch_theme_assets.pyextracts the full wheel contents, bringing templates and build artifacts in sync with upstream. Compliance patches (license headers, inclusive language) are applied automatically post-extraction. Changes made locally (e.g., during a Sphinx upgrade) are backported toairflow-sitevia PR.Motivation
As described in #45576, modifying the Sphinx docs theme currently requires building and publishing a
.whltoairflow.apache.orgbefore changes can be tested against Airflow docs. Adding the theme as a uv workspace member meansuv syncresolves it from the localdocs-theme/directory. Editing a template and rebuilding docs immediately reflects the change.Was generative AI tooling used to co-author this PR?