Skip to content

Commit 0af1853

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 6c28ec0 commit 0af1853

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

docs/Makefile

Lines changed: 16 additions & 1 deletion
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,22 @@ all: dirhtml
1920
# Setup commands
2021
.PHONY: setupenv
2122
setupenv:
22-
pip install -q poetry
2323
sudo apt-get install gcc python3-dev libev4 libev-dev
24+
@while IFS= read -r line; do \
25+
if [[ "$${line}" =~ ^[[:space:]]*requires[[:space:]]*= ]]; then\
26+
content="$${line#*=}";\
27+
content="$${content//[[:space:]]/}";\
28+
content="$${content#[}";\
29+
content="$${content%]}";\
30+
IFS=',' read -ra items <<< "$$content";\
31+
for item in "$${items[@]}"; do\
32+
item="$${item%\"}";\
33+
item="$${item#\"}";\
34+
pip install "$$item";\
35+
done;\
36+
fi;\
37+
done < pyproject.toml
38+
2439

2540
.PHONY: setup
2641
setup:

docs/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ scylla-driver = { path = "../", develop = true }
2626

2727

2828
[build-system]
29-
requires = ["poetry>=1.8.0"]
29+
requires = ["poetry==2.2.0"]
3030
build-backend = "poetry.masonry.api"

0 commit comments

Comments
 (0)