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:
|
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
|
||||||
@@ -40,23 +49,15 @@ jobs:
|
|||||||
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:
|
||||||
python-version: '3.12'
|
name: html-docs
|
||||||
- name: Install dependencies
|
path: build/html
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
- name: Add .nojekyll file
|
||||||
pip install -r requirements.txt
|
run: touch build/html/.nojekyll
|
||||||
- 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: Deploy to gh-pages
|
- name: Deploy to gh-pages
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
with:
|
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::
|
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::
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user