Don't need hatch to build documentation

This is a partial revert of:
47d1015e ("Replace setuptools and setup.py with hatch and pyproject.toml", 2022-09-05)

Also hatch is an option to run tests.
This commit is contained in:
Chris Mayo 2022-09-13 19:32:06 +01:00
parent af265f3d52
commit b6a7f2d313
9 changed files with 37 additions and 41 deletions

View file

@ -26,8 +26,8 @@ jobs:
- name: Install Python packages
run: >
pip3 install dnspython beautifulsoup4 requests \
hatch hatch-vcs sphinx sphinx_epytext sphinx_rtd_theme \
sphinx-sitemap sphinx-intl
hatchling hatch-vcs sphinx sphinx_epytext \
sphinx_rtd_theme sphinx-sitemap sphinx-intl
- name: Prepare git environment
run: |
@ -39,9 +39,9 @@ jobs:
- name: Build man pages
run: |
python3 -m hatchling build --hooks-only
hatch -e doc run locale
make -C doc locale
git commit -a -m "Update doc translation catalogs"
hatch -e doc run man
make -C doc man
git commit -a -m "Update man pages"
- name: Build application translations catalogs

View file

@ -104,15 +104,16 @@ jobs:
- name: Install Python packages
run: |
pip install -U -r requirements.txt hatch hatch-vcs Sphinx \
pip install -U -r requirements.txt hatchling hatch-vcs Sphinx \
sphinx-epytext sphinx-intl sphinx-rtd-theme sphinx-sitemap
- name: Build
run: |
hatch -e doc run code
hatch -e doc run html
hatch -e doc run locale
hatch -e doc run man
python3 -m hatchling build --hooks-only
make -C doc code
make -C doc html
make -C doc locale
make -C doc man
make -C doc check
lint:

View file

@ -30,14 +30,14 @@ jobs:
- name: Install Python packages
run: >
pip install dnspython beautifulsoup4 requests \
hatch hatch-vcs sphinx sphinx_epytext sphinx_rtd_theme \
sphinx-sitemap
hatchling hatch-vcs sphinx sphinx_epytext \
sphinx_rtd_theme sphinx-sitemap
- name: Build
run: |
python3 -m hatchling build --hooks-only
hatch -e doc run code
hatch -e doc run html
make -C doc code
make -C doc html
- name: Publish
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305

View file

@ -11,15 +11,18 @@ clean:
locale:
$(MAKE) -C po
test:
hatch -e test run tests
linkcheck/_release.py:
hatchling build -t sdist --hooks-only
test: linkcheck/_release.py
tox -e py
upload:
twine upload dist/LinkChecker*
homepage:
hatch -e doc run code
hatch -e doc run html
homepage: linkcheck/_release.py
make -C doc code
make -C doc html
dist:
hatchling build

View file

@ -4,7 +4,6 @@ Changes:
- PyXDG is no longer used
- setuptools and setup.py replaced with hatchling and pyproject.toml
- The application version is derived from git tags using hatch-vcs
- Documentation build is run using hatch
- Binary translation catalogs are compiled using polib during distribution
package building and are now included in sdist packages
- Warning url-rate-limited renamed to http-rate-limited.

View file

@ -19,9 +19,10 @@ sphinx_sitemap
Configuration
-------------
Before building either man pages or HTML, the package metadata needs to be
created to derive copyright, author and version values. Running Sphinx in a
hatch environment manages this for us.
Before building either man pages or HTML, generate ``linkcheck/_release.py``
containing copyright, author and version with:
``hatchling build --hooks-only``
Man Pages
@ -31,7 +32,7 @@ Source files are in doc/src/man.
The pages can be built with:
``linkchecker $ hatch -e doc run man``
``linkchecker/doc $ make man``
The files are saved in doc/man.
@ -46,11 +47,11 @@ HTML
``doc/src/code/index.rst`` gives an overview of the LinkChecker code, optionally a navigable
copy of the LinkChecker source can be created with:
``linkchecker $ hatch -e doc run code``
``linkchecker/doc $ make code``
Build the HTML files with:
``linkchecker $ hatch -e doc run html``
``linkchecker/doc $ make html``
The files are saved in doc/html.

View file

@ -1,3 +1,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
import linkcheck.configuration

View file

@ -28,6 +28,9 @@ Man Page Translations
Sphinx is used to generate .pot and .po (with sphinx-intl) files in i18n/
and man pages in man/.
If the application metadata has not been created, first run:
``linkchecker $ hatchling build -t sdist --hooks-only``
Create man.pot file in i18n/gettext/:
``linkchecker/doc $ make -C src gettext``
@ -42,7 +45,7 @@ These two steps can be performed with:
Create man pages:
``linkchecker/doc $ hatch -e doc run man``
``linkchecker/doc $ make man``
After updating the source files all steps need to be repeated, if translations
alone have been changed in the .po file only the last step is needed.

View file

@ -86,21 +86,6 @@ source = "vcs"
local_scheme = "node-and-timestamp"
version_scheme = "post-release"
[tool.hatch.envs.doc]
dependencies = [
"sphinx",
"sphinx_epytext",
"sphinx_intl",
"sphinx_rtd_theme",
"sphinx-sitemap",
]
[tool.hatch.envs.doc.scripts]
code = "make -C doc code"
html = "make -C doc html"
locale = "make -C doc locale"
man = "make -C doc man"
[tool.hatch.envs.test]
dependencies = [
"miniboa",