diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 6b760a2..5cd52ba 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -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 && pip install . + run: pip install --no-deps -r requirements/requirements-docs.txt && pip install . - name: Build site - run: mkdocs build + run: mkdocs build --strict - name: Upload to GitHub Pages uses: actions/upload-pages-artifact@v2 with: diff --git a/.tools/docs-dependencies.sh b/.tools/docs-dependencies.sh deleted file mode 100755 index eebbf94..0000000 --- a/.tools/docs-dependencies.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -e - -hatch env show --json | jq -r ".docs.dependencies | .[]" | pip-compile -U - -o docs/requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 5699972..aadcb7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,12 @@ path = "markdown_callouts/__init__.py" [tool.hatch.build.targets.sdist] include = ["/markdown_callouts", "/tests"] +[tool.hatch.env] +requires = [ + "hatch-mkdocs", + "hatch-pip-compile", +] + [tool.hatch.envs.default.scripts] all = [ "hatch run style:fix", @@ -92,14 +98,10 @@ format = [ "ruff format -q markdown_callouts tests", ] +[tool.hatch.env.collectors.mkdocs.docs] [tool.hatch.envs.docs] -detached = true -dependencies = [ - "mkdocs >=1.5", - "mkdocs-material >=7.1.4", - "pymdown-extensions >=8.2", - "markdown-callouts >=0.1", -] +type = "pip-compile" +pip-compile-hashes = false [tool.ruff] line-length = 100 diff --git a/docs/requirements.txt b/requirements/requirements-docs.txt similarity index 90% rename from docs/requirements.txt rename to requirements/requirements-docs.txt index 8244fb7..ae57aa6 100644 --- a/docs/requirements.txt +++ b/requirements/requirements-docs.txt @@ -1,9 +1,12 @@ # -# 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 +# - pymdown-extensions # + babel==2.13.1 # via mkdocs-material certifi==2023.7.22