Skip to content

Commit 097ab70

Browse files
refactor: replace requirements.txt with Poetry for dependency management
- Add pyproject.toml with Poetry configuration - Update GitHub Actions workflow to use Poetry - Remove requirements.txt in favor of Poetry - Add caching for Poetry dependencies in CI Poetry provides better dependency resolution and lock file support, ensuring consistent builds across environments.
1 parent dd4e68a commit 097ab70

3 files changed

Lines changed: 41 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,30 @@ jobs:
2828
uses: actions/setup-python@v5
2929
with:
3030
python-version: '3.11'
31-
cache: 'pip'
31+
32+
- name: Install Poetry
33+
uses: snok/install-poetry@v1
34+
with:
35+
virtualenvs-create: true
36+
virtualenvs-in-project: true
37+
installer-parallel: true
38+
39+
- name: Load cached venv
40+
id: cached-poetry-dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: .venv
44+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
3245

3346
- name: Install dependencies
34-
run: |
35-
pip install -r requirements.txt
47+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
48+
run: poetry install --no-interaction --no-root
49+
50+
- name: Install project
51+
run: poetry install --no-interaction
3652

3753
- name: Build site
38-
run: mkdocs build
54+
run: poetry run mkdocs build
3955

4056
- name: Upload artifact
4157
uses: actions/upload-pages-artifact@v3

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.poetry]
2+
name = "valdris"
3+
version = "1.0.0"
4+
description = "Valdris D&D Campaign World Documentation"
5+
authors = ["Offending Commit <offendingcommit@gmail.com>"]
6+
readme = "README.md"
7+
license = "CC-BY-SA-4.0"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.11"
11+
mkdocs = "^1.6.0"
12+
mkdocs-material = "^9.5.18"
13+
mkdocs-awesome-pages-plugin = "^2.9.2"
14+
pymdown-extensions = "^10.7.1"
15+
mkdocs-material-extensions = "^1.3.1"
16+
17+
[tool.poetry.group.dev.dependencies]
18+
19+
[build-system]
20+
requires = ["poetry-core"]
21+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)