Update docs and docs ci job to use uv
This commit is contained in:
55
.github/workflows/docs.yml
vendored
55
.github/workflows/docs.yml
vendored
@@ -11,24 +11,33 @@ jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install dependencies
|
||||
|
||||
- name: Install project and dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Build pycapnp and install
|
||||
run: |
|
||||
python setup.py build
|
||||
pip install .
|
||||
# This replaces requirements.txt, setup.py build, and pip install .
|
||||
# It reads pyproject.toml, builds pycapnp, and installs it into a fast .venv
|
||||
uv sync --all-extras
|
||||
|
||||
- name: Build documentation
|
||||
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
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: html-docs
|
||||
path: build/html
|
||||
@@ -40,23 +49,15 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
- name: Download documentation artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Build pycapnp and install
|
||||
run: |
|
||||
python setup.py build
|
||||
pip install .
|
||||
- name: Build documentation
|
||||
run: |
|
||||
sphinx-build docs build/html
|
||||
touch build/html/.nojekyll
|
||||
name: html-docs
|
||||
path: build/html
|
||||
|
||||
- name: Add .nojekyll file
|
||||
run: touch build/html/.nojekyll
|
||||
|
||||
- name: Deploy to gh-pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
|
||||
@@ -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::
|
||||
|
||||
pipenv install
|
||||
pip install -r requirements.txt
|
||||
cd pycapnp
|
||||
uv venv
|
||||
uv sync
|
||||
source .venv/bin/activate
|
||||
|
||||
And install pycapnp with::
|
||||
|
||||
cd pycapnp
|
||||
pip install .
|
||||
uv pip install .
|
||||
|
||||
|
||||
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::
|
||||
|
||||
pipenv install
|
||||
pip install -r requirements.txt
|
||||
cd pycapnp
|
||||
uv venv
|
||||
uv sync
|
||||
source .venv/bin/activate
|
||||
|
||||
Building::
|
||||
|
||||
cd pycapnp
|
||||
pip install .
|
||||
uv pip install .
|
||||
|
||||
Useful targets for setup.py::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user