Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/_publish-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,6 @@ jobs:
find "$ARTIFACTS_PATH" -maxdepth 1 -type f -name "*.whl" -printf "- \`%f\`\n"
} >> "$GITHUB_STEP_SUMMARY"

- name: Require immutable releases
if: github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
enabled=$(gh api \
"repos/${{ github.repository }}/immutable-releases" \
--jq '.enabled')
if [[ "$enabled" != 'true' ]]; then
echo "::error::Immutable releases must be enabled for ${{ github.repository }}."
exit 1
fi

- name: Create draft release and upload assets
if: github.ref == 'refs/heads/main'
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:

- name: Install package doc generator dependencies
if: github.event.action != 'closed'
run: pip install -r docs/requirements.txt
run: pip install -r ci_scripts/requirements.txt

- name: Generate package pages from YAML
if: github.event.action != 'closed'
run: python docs/packages/generate_packages_doc.py
run: python ci_scripts/generate_packages_doc.py

- name: Compute preview baseurl
if: github.event.action != 'closed'
Expand Down Expand Up @@ -103,10 +103,10 @@ jobs:
python-version: '3'

- name: Install package doc generator dependencies
run: pip install -r docs/requirements.txt
run: pip install -r ci_scripts/requirements.txt

- name: Generate package pages from YAML
run: python docs/packages/generate_packages_doc.py
run: python ci_scripts/generate_packages_doc.py

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import glob
import html
import os
from pathlib import Path
import re
from urllib.parse import quote

Expand All @@ -17,6 +18,9 @@
RST_LINK_RE = re.compile(r"`([^`<]+?)\s*<([^>]+)>`_+")
PACKAGE_NORMALIZE_RE = re.compile(r"[-_.]+")

CI_SCRIPTS_DIR = Path(os.path.dirname(os.path.abspath(__file__)))
DOCS_DIR = (CI_SCRIPTS_DIR / ".." / "docs" / "packages").resolve()


def normalize_package_name(package_name):
"""Return the normalized project name required by the Simple API."""
Expand Down Expand Up @@ -256,8 +260,8 @@ def generate_md_page(yaml_file, output_md):
return package_name, output_md


def process_all_yaml_files():
out_dir = os.path.dirname(os.path.abspath(__file__))
def process_all_yaml_files(out_dir):
print(f"Processing all YAML files in {out_dir}...")
yaml_files = sorted(glob.glob(os.path.join(out_dir, "*.yaml")))
if not yaml_files:
print(f"No YAML files found in {out_dir}")
Expand Down Expand Up @@ -349,4 +353,4 @@ def generate_index(package_entries, out_dir):


if __name__ == "__main__":
process_all_yaml_files()
process_all_yaml_files(DOCS_DIR)
File renamed without changes.
7 changes: 4 additions & 3 deletions ci_scripts/update_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
corresponding docs/packages/<name>.yaml entry with the new version, and open
a pull request with the change.

docs/packages/generate_packages_doc.py renders this YAML into the published
generate_packages_doc.py renders this YAML into the published
Markdown pages, so this script only needs to maintain the YAML source of
truth; it never touches docs/packages/*.md or index.md directly.
"""
Expand All @@ -27,8 +27,9 @@
import yaml

REPO = "riseproject-dev/python-wheels"
DOCS_DIR = Path("docs/packages")
PACKAGES_FILE = Path("ci_scripts/packages.txt")
CI_SCRIPTS_DIR = Path(os.path.dirname(os.path.abspath(__file__)))
DOCS_DIR = (CI_SCRIPTS_DIR / ".." / "docs" / "packages").resolve()
PACKAGES_FILE = CI_SCRIPTS_DIR / "packages.txt"
ARTIFACTS_PATH = os.environ.get("ARTIFACTS_PATH", "dist")
RELEASE_TAG = os.environ.get("RELEASE_TAG")
GPL_SOURCES_DESCRIPTION = os.environ.get("GPL_SOURCES_DESCRIPTION", "").strip()
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ apply for certain projects. Every `build-<package>.yml` workflow calls
1. Downloads the built wheel(s) from the previous job
2. Creates an immutable GitHub Release containing the wheels
3. Opens a PR against `docs/packages/<name>.yaml` documenting the new version
(via `ci_scripts/update_doc.py`), which `docs/packages/generate_packages_doc.py`
(via `ci_scripts/update_doc.py`), which `ci_scripts/generate_packages_doc.py`
later renders into the published Markdown page. With it in place, the
`build-numpy.yml` script's `publish` job looks like this:

Expand Down
1 change: 0 additions & 1 deletion docs/requirements-dev.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/sdist-source-and-versi
up in the `.whl` filename (driven by `BUILD_VERSION`) must match, byte for byte:
(1) the wheel filename, (2) the `docs/packages/<pkg>.yaml` `version:` key
(auto-populated by `update_doc.py` from the wheel), and (3) the
`patches/<pkg>/<version>/` directory name — `docs/.../generate_packages_doc.py`
`patches/<pkg>/<version>/` directory name — `generate_packages_doc.py`
links patches as the literal path `patches/{name}/{version}`, so a mismatch is a
404. torch ships a **local segment** (`2.13.0+cpu`, pytorch's CPU-index
convention) so its patches live under `patches/torch/2.13.0+cpu/`.
Expand Down
Loading