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 3027f1c commit 39e434a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 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.

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

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

[tool.hatch.build.targets.wheel]
packages = ["mkdocstrings_handlers"]

Expand Down Expand Up @@ -98,17 +104,10 @@ format = [
"ruff format -q mkdocstrings_handlers tests",
]

[tool.hatch.env.collectors.mkdocs.docs]
[tool.hatch.envs.docs]
detached = true
dependencies = [
"mkdocs >=1.5",
"mkdocs-material >=7.1.4",
"mkdocs-section-index >=0.3.0",
"mkdocstrings >=0.15.0",
"mkdocstrings-python >=0.7.1",
"pymdown-extensions >=8.2",
"markdown-callouts >=0.2",
]
type = "pip-compile"
pip-compile-hashes = false

[tool.ruff]
line-length = 100
Expand Down
12 changes: 9 additions & 3 deletions docs/requirements.txt → requirements/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#
# 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 -
# - markdown-callouts
# - mkdocs
# - mkdocs-material
# - mkdocs-section-index
# - mkdocstrings
# - mkdocstrings-python
# - pymdown-extensions
#

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

0 comments on commit 39e434a

Please sign in to comment.