Skip to content

Commit 0cc0b5b

Browse files
committed
Use hatch-mkdocs and hatch-pip-compile for docs deps
1 parent 99c7699 commit 0cc0b5b

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Install Python
1414
uses: actions/setup-python@v4
1515
with:
16-
python-version: '3.x'
16+
python-version: '3.11'
1717
- name: Install dependencies
18-
run: pip install --no-deps -r docs/requirements.txt
18+
run: pip install --no-deps -r requirements/requirements-docs.txt
1919
- name: Build site
20-
run: mkdocs build
20+
run: mkdocs build --strict
2121
- name: Upload to GitHub Pages
2222
uses: actions/upload-pages-artifact@v2
2323
with:

.tools/docs-dependencies.sh

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

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ path = "mkdocs_same_dir/__init__.py"
4949
[tool.hatch.build.targets.sdist]
5050
include = ["/mkdocs_same_dir"]
5151

52+
[tool.hatch.env]
53+
requires = [
54+
"hatch-mkdocs",
55+
"hatch-pip-compile",
56+
]
57+
5258
[tool.hatch.envs.default.scripts]
5359
all = [
5460
"hatch run style:fix",
@@ -84,13 +90,10 @@ format = [
8490
"ruff format -q mkdocs_same_dir",
8591
]
8692

93+
[tool.hatch.env.collectors.mkdocs.docs]
8794
[tool.hatch.envs.docs]
88-
detached = true
89-
dependencies = [
90-
"mkdocs >=1.5",
91-
"mkdocs-material >=7.1.4",
92-
"pymdown-extensions >=8.2",
93-
]
95+
type = "pip-compile"
96+
pip-compile-hashes = false
9497

9598
[tool.ruff]
9699
line-length = 100

docs/requirements.txt renamed to requirements/requirements-docs.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
3-
# by the following command:
2+
# This file is autogenerated by hatch-pip-compile with Python 3.11
43
#
5-
# pip-compile --output-file=docs/requirements.txt -
4+
# - mkdocs
5+
# - mkdocs-material
6+
# - pymdown-extensions
67
#
8+
79
babel==2.13.1
810
# via mkdocs-material
911
certifi==2023.7.22

0 commit comments

Comments
 (0)