Skip to content

Commit

Permalink
Use hatch-mkdocs and hatch-pip-compile for docs deps
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 24, 2023
1 parent 60432a9 commit fff0eac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: Install dependencies
run: pip install --no-deps -r docs/requirements.txt
run: pip install --no-deps -r requirements/requirements-docs.txt
- name: Build site
run: mkdocs build
run: mkdocs build --strict
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v2
with:
Expand Down
4 changes: 0 additions & 4 deletions .tools/docs-dependencies.sh

This file was deleted.

14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ path = "mkdocs_section_index/__init__.py"
[tool.hatch.build.targets.sdist]
include = ["/mkdocs_section_index", "/tests"]

[tool.hatch.env]
requires = [
"hatch-mkdocs",
"hatch-pip-compile",
]

[tool.hatch.envs.default.scripts]
all = [
"hatch run style:fix",
Expand Down Expand Up @@ -97,12 +103,10 @@ format = [
"ruff format -q mkdocs_section_index tests",
]

[tool.hatch.env.collectors.mkdocs.docs]
[tool.hatch.envs.docs]
detached = true
dependencies = [
"mkdocs >=1.5",
"mkdocs-material >=7.3.6",
]
type = "pip-compile"
pip-compile-hashes = false

[tool.ruff]
line-length = 100
Expand Down
8 changes: 5 additions & 3 deletions docs/requirements.txt → requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
# This file is autogenerated by hatch-pip-compile with Python 3.11
#
# pip-compile --output-file=docs/requirements.txt -
# - mkdocs
# - mkdocs-material
# - pymdown-extensions
#

babel==2.13.1
# via mkdocs-material
certifi==2023.7.22
Expand Down

0 comments on commit fff0eac

Please sign in to comment.