Skip to content

Commit 53ed94b

Browse files
committed
docs: borrow poetry version from docs/pyproject.toml
In order make docs build reproducible we need to lock poetry version. It will also help with pip cache invalidation on the pipeline, hash will be calculated from `docs/pyproject.toml`. Does two things: 1. Lock poetry version in `docs/pyproject.toml` 2. Pull version from `docs/pyproject.toml` in `Makefile`
1 parent 147d451 commit 53ed94b

File tree

6 files changed

+3005
-210
lines changed

6 files changed

+3005
-210
lines changed

.github/workflows/docs-pages.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ jobs:
2424
fetch-depth: 0
2525

2626
- uses: actions/cache@v4
27-
# actions/setup-python poetry cache feature requires poetry to be installed beforehand
28-
# which makes use of it extremely awkward.
2927
with:
3028
path: |
31-
/home/runner/.cache/pip
3229
/home/runner/.cache/pypoetry
33-
# python and poetry version are in docs/pyproject.toml
34-
key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/pyproject.toml', 'docs/Makefile') }}
30+
key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/poetry.lock') }}
3531

36-
- name: Set up Python
37-
uses: actions/setup-python@v5
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v6
3834
with:
39-
python-version-file: docs/pyproject.toml
35+
version-file: 'docs/pyproject.toml'
36+
enable-cache: true
37+
cache-dependency-glob: |
38+
docs/pyproject.toml
39+
docs/uv.lock
4040
4141
- name: Set up env
4242
run: make -C docs setupenv

.github/workflows/docs-pr.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ jobs:
2626
fetch-depth: 0
2727

2828
- uses: actions/cache@v4
29-
# actions/setup-python poetry cache feature requires poetry to be installed beforehand
30-
# which makes use of it extremely awkward.
3129
with:
3230
path: |
33-
/home/runner/.cache/pip
3431
/home/runner/.cache/pypoetry
35-
# python and poetry version are in docs/pyproject.toml
36-
key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/pyproject.toml', 'docs/Makefile') }}
32+
key: docs-cache-${{ runner.os }}-${{ hashFiles('docs/poetry.lock') }}
3733

38-
- name: Set up Python
39-
uses: actions/setup-python@v5
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v6
4036
with:
41-
python-version-file: docs/pyproject.toml
37+
version-file: 'docs/pyproject.toml'
38+
enable-cache: true
39+
cache-dependency-glob: |
40+
docs/pyproject.toml
41+
docs/uv.lock
4242
4343
- name: Set up env
4444
run: make -C docs setupenv

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Global variables
22
# You can set these variables from the command line.
3+
SHELL = bash
34
POETRY = poetry
45
SPHINXOPTS = -j auto
56
SPHINXBUILD = $(POETRY) run sphinx-build
@@ -19,8 +20,7 @@ all: dirhtml
1920
# Setup commands
2021
.PHONY: setupenv
2122
setupenv:
22-
pip install -q poetry
23-
sudo apt-get install gcc python3-dev libev4 libev-dev
23+
uv pip install -r <(uv pip compile pyproject.toml)
2424

2525
.PHONY: setup
2626
setup:

0 commit comments

Comments
 (0)