Update docs and docs ci job to use uv

This commit is contained in:
Jacob Alexander
2026-07-02 23:48:12 -07:00
parent 4b2f92e9d1
commit 6aa1849da6
2 changed files with 51 additions and 48 deletions

View File

@@ -11,55 +11,56 @@ jobs:
docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v6 uses: actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
- name: Install dependencies
- name: Install project and dependencies
run: | run: |
python -m pip install --upgrade pip # This replaces requirements.txt, setup.py build, and pip install .
pip install -r requirements.txt # It reads pyproject.toml, builds pycapnp, and installs it into a fast .venv
- name: Build pycapnp and install uv sync --all-extras
run: |
python setup.py build
pip install .
- name: Build documentation - name: Build documentation
run: | run: |
sphinx-build docs build/html # uv run executes sphinx within the isolated virtual environment
uv run sphinx-build docs build/html
- name: Upload documentation artifact - name: Upload documentation artifact
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v4
with: with:
name: html-docs name: html-docs
path: build/html path: build/html
deploy: deploy:
needs: docs needs: docs
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v5 - name: Download documentation artifact
- name: Set up Python uses: actions/download-artifact@v4
uses: actions/setup-python@v6 with:
with: name: html-docs
python-version: '3.12' path: build/html
- name: Install dependencies
run: | - name: Add .nojekyll file
python -m pip install --upgrade pip run: touch build/html/.nojekyll
pip install -r requirements.txt
- name: Build pycapnp and install - name: Deploy to gh-pages
run: | uses: peaceiris/actions-gh-pages@v4
python setup.py build with:
pip install . github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build documentation publish_dir: ./build/html
run: | publish_branch: gh-pages
sphinx-build docs build/html
touch build/html/.nojekyll
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
publish_branch: gh-pages

View File

@@ -42,13 +42,14 @@ If you want the latest development version, you can clone the github repo::
For development packages use one of the following to install the python dependencies:: For development packages use one of the following to install the python dependencies::
pipenv install cd pycapnp
pip install -r requirements.txt uv venv
uv sync
source .venv/bin/activate
And install pycapnp with:: And install pycapnp with::
cd pycapnp uv pip install .
pip install .
Development Development
@@ -59,13 +60,14 @@ Clone the repo from https://github.com/capnproto/pycapnp.git::
For development packages use one of the following to install the python dependencies:: For development packages use one of the following to install the python dependencies::
pipenv install cd pycapnp
pip install -r requirements.txt uv venv
uv sync
source .venv/bin/activate
Building:: Building::
cd pycapnp uv pip install .
pip install .
Useful targets for setup.py:: Useful targets for setup.py::