Skip to content

Commit 0e47bdd

Browse files
authored
docs: rework package file formats and doc generation (#171)
* docs: packages: replace markdown files with YAML This makes python-wheels more consistent with the original package docs' pattern in wheel_builder. * ci_scripts: check_versions.py: fix docs path We were still using the old docs/source/packages path, rather than the docs/packages path in python-wheels. * docs: packages: generate_packages_doc.py: fix paths, registry URLs Use simpler logic and the new proxy URL for the package registry when generating docs. * docs: add .gitignore for .md files These are generated for documentation deployment, but they shouldn't be committed to the repository anymore, only deployed by a workflow. * workflows: docs: add Create a custom workflow for deploying our documentation to GitHub Pages. This allows us to retain the original YAML-to-documentation generation process we've used in the past, and stops us from relying solely on files already being on the main branch for documentation build and review. We have to incorporate two new community actions for this: 1. `peaceiris/actions-gh-pages`, for deploying the actual docs using a `gh-pages` branch 2. `rossjrew/pr-preview-action`, for creating docs previews so we're able to review the changes before merge. Comments will be posted on the PR providing preview links. The `gh-pages` branch also requires a `.nojekyll` file at the project root to avoid a manual rebuild, which can take a lot of time. Finally, the `Deploy from a branch` option in the Pages setting needs to point at `root/`, not `docs/` or it won't find the `.nojekyll` file. * docs: infrastructure.md: document Pages configuration for docs.yml workflow --------- AI-Generated: Uses Claude Sonnet 5 Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent b23b017 commit 0e47bdd

156 files changed

Lines changed: 1250 additions & 5948 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Build and deploy documentation
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- "docs/**"
11+
pull_request:
12+
types: [opened, synchronize, reopened, closed]
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: docs-${{ github.ref }}
17+
18+
jobs:
19+
preview:
20+
if: github.event_name == 'pull_request'
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
pull-requests: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: actions/setup-python@v5
29+
if: github.event.action != 'closed'
30+
with:
31+
python-version: '3'
32+
33+
- name: Install package doc generator dependencies
34+
if: github.event.action != 'closed'
35+
run: pip install -r docs/requirements.txt
36+
37+
- name: Generate package pages from YAML
38+
if: github.event.action != 'closed'
39+
run: python docs/packages/generate_packages_doc.py
40+
41+
- name: Compute preview baseurl
42+
if: github.event.action != 'closed'
43+
id: preview_baseurl
44+
run: |
45+
base=$(python3 -c "import yaml; print(yaml.safe_load(open('docs/_config.yml'))['baseurl'])")
46+
echo "value=${base}/pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT"
47+
48+
- uses: ruby/setup-ruby@v1
49+
if: github.event.action != 'closed'
50+
with:
51+
ruby-version: '3.3'
52+
53+
# actions/jekyll-build-pages has no way to override _config.yml's
54+
# hardcoded baseurl, but a preview is served one path segment deeper
55+
# (.../pr-preview/pr-<N>/) than the production site, so it needs its
56+
# own baseurl or every internal link/asset would point at production.
57+
- name: Build with Jekyll
58+
if: github.event.action != 'closed'
59+
run: |
60+
# jekyll-remote-theme only fetches just-the-docs' layouts/assets;
61+
# its own gem dependencies (jekyll-seo-tag, jekyll-include-cache,
62+
# rake) still have to be installed separately.
63+
gem install jekyll jekyll-remote-theme jekyll-seo-tag jekyll-include-cache rake --no-document
64+
jekyll build --source docs --destination _site \
65+
--baseurl "${{ steps.preview_baseurl.outputs.value }}"
66+
67+
# Auto-detects deploy vs. removal from the pull_request event action,
68+
# so this same step both publishes updates and tears down the preview
69+
# when the PR is closed.
70+
#
71+
# wait-for-pages-deployment is deliberately left at its default
72+
# (false): on classic "deploy from a branch" Pages, its lookup against
73+
# the legacy Pages Builds API doesn't reliably find an exact-commit
74+
# build within its hardcoded 180s timeout, and that timeout is a hard,
75+
# non-configurable `exit 1` that fails the whole step/PR check even
76+
# when the preview deployed and is serving correctly. A link that's
77+
# occasionally not live for a few seconds is a smaller problem than a
78+
# misleading red X on an otherwise-working PR.
79+
- name: Deploy or remove PR preview
80+
uses: rossjrw/pr-preview-action@v1
81+
with:
82+
source-dir: ./_site
83+
84+
deploy:
85+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
86+
runs-on: ubuntu-latest
87+
permissions:
88+
contents: write
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- uses: actions/setup-python@v5
93+
with:
94+
python-version: '3'
95+
96+
- name: Install package doc generator dependencies
97+
run: pip install -r docs/requirements.txt
98+
99+
- name: Generate package pages from YAML
100+
run: python docs/packages/generate_packages_doc.py
101+
102+
- name: Build with Jekyll
103+
uses: actions/jekyll-build-pages@v1
104+
with:
105+
source: ./docs
106+
destination: ./_site
107+
108+
- name: Deploy to GitHub Pages
109+
uses: peaceiris/actions-gh-pages@v4
110+
with:
111+
github_token: ${{ secrets.GITHUB_TOKEN }}
112+
publish_dir: ./_site
113+
keep_files: true

ci_scripts/check_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def create_deprecation_pr(package: str, reason: str) -> Optional[str]:
166166
git_run("fetch", "origin")
167167
git_run("switch", "main")
168168

169-
yaml_file = Path(f"docs/source/packages/{package}.yaml")
169+
yaml_file = Path(f"docs/packages/{package}.yaml")
170170
if not yaml_file.exists():
171171
print(f" [!] YAML file for {package} does not exist")
172172
return None

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages/*.md

docs/infrastructure.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,25 @@ regenerated by a project administrator/owner.
6666
|-------|-------|------|--------|----------|--------|
6767
| `PYTHON_CI_GROUP_TOKEN` | Group ([Python](https://gitlab.com/riseproject/python)) | Maintainer | `api`, `read_api`, `read_repository`, `write_repository` | MR pipeline triggers, auto updates/checks | 1 year (April 19th, 2027) |
6868
| `rise-github-package-registry` | Repository deploy token ([wheel_builder](https://gitlab.com/riseproject/python/wheel_builder/-/settings/repository#js-deploy-tokens)) | n/a (deploy token) | `read_package_registry`, `write_package_registry` | Push wheels GitHub → GitLab package registry | 1 year (June 29th, 2027) |
69+
70+
## GitHub Pages Configuration
71+
72+
The `.github/workflows/docs.yml` workflow handles building and deploying
73+
documentation, including providing previews of the docs on a per-PR basis. For
74+
this to work correctly, the following settings need to be configured under
75+
`Settings -> Pages -> Build and deployment` in the repository:
76+
77+
1. `Source` should be set to `Deploy from a branch`
78+
2. `Branch` should be set to `gh-pages` `/(root)`
79+
80+
When this is configured, any changes touching the `docs` folder will trigger a
81+
docs build, where upon completion the `rossjrw/pr-preview-action` will
82+
automatically comment on the PR with a link looking like:
83+
84+
```
85+
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-171/
86+
```
87+
88+
Note that the `gh-pages` branch should be automatically created by the
89+
workflows, but if not it must be created manually with an empty `.nojekyll` file
90+
in the project root to avoid long rebuild times.

docs/packages/aiohttp.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

docs/packages/aiohttp.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
deprecated:
2+
package-name: aiohttp
3+
source-code: https://github.com/aio-libs/aiohttp
4+
license: Apache-2.0
5+
warning: |
6+
We disable the tests in tests/autobahn/test_autobahn as they depend on
7+
docker_on_whales and we don't want to be testing docker builds as part of
8+
the pipeline.
9+
10+
We also disable a flaky uvloop test, and tests that contain the following
11+
patterns, involving consistent failures related to networking or permissions:
12+
13+
- test_no_warnings
14+
- test_static_directory_without_read_permission
15+
- test_static_file_without_read_permission
16+
- test_uvloop_secure_https_proxy
17+
versions:
18+
- version: 3.11.18
19+
patched:
20+
- version: 3.12.14
21+
patched:

docs/packages/argon2-cffi-bindings.md

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package-name: argon2-cffi-bindings
2+
source-code: https://github.com/hynek/argon2-cffi-bindings
3+
license: MIT/CC0(libargon2)
4+
versions:
5+
- version: 21.2.0
6+
- version: 25.1.0

docs/packages/blake3.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

docs/packages/blake3.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
deprecated:
2+
package-name: blake3
3+
source-code: https://github.com/oconnor663/blake3-py
4+
license: CC0-1.0 OR Apache-2.0
5+
versions:
6+
- version: 1.0.5
7+
- version: 1.0.6
8+
- version: 1.0.7
9+
- version: 1.0.8

0 commit comments

Comments
 (0)