Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Use uv package and project manager on GHA and RTD #569

Merged
merged 2 commits into from
Feb 7, 2025
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
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: |
setup.py
enable-cache: true
version: "latest"

- name: Build package
run: |
alias pip="uv pip"
make build
10 changes: 10 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: |
setup.py
cache-suffix: ${{ matrix.python-version }}
enable-cache: true
version: "latest"

- name: Install PlantUML on Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -46,4 +55,5 @@ jobs:

- name: Build docs
run: |
alias pip="uv pip"
cd docs && make check
26 changes: 20 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,36 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.12"
python: "3.13"
apt_packages:
- plantuml

# Bundle assets, because `pip install --editable=.` does not do it.
jobs:

# Install `uv`.
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv venv

# Install dependencies using `uv`.
install:
- uv pip install -r docs/requirements.txt

# Bundle assets, because `pip install --editable=.` does not do it.
pre_build:
- make bundle-develop
- cd docs; make bundle-assets

# Invoke the build also using `uv`.
build:
html:
- uv run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true

python:
install:
- requirements: docs/requirements.txt
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Install the local crate-docs-theme package by specifying parent directory,
# because `pip` is run from there.
# Install the `crate-docs-theme` package from the local working tree
# in editable mode. `pip` is invoked from the root directory.
--editable=.