diff --git a/.github/workflows/branch-man.yml b/.github/workflows/branch-man.yml index 2f5c992d..c7e3df4b 100644 --- a/.github/workflows/branch-man.yml +++ b/.github/workflows/branch-man.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 095ddb34..ab84869b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml index fa06937a..61191435 100644 --- a/.github/workflows/publish-pages.yml +++ b/.github/workflows/publish-pages.yml @@ -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 diff --git a/Makefile b/Makefile index 737e4200..0c220627 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/doc/changelog.txt b/doc/changelog.txt index abc9a94b..f87e9a90 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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. diff --git a/doc/documentation.md b/doc/documentation.md index d8bf4d65..0050d32b 100644 --- a/doc/documentation.md +++ b/doc/documentation.md @@ -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. diff --git a/doc/src/conf.py b/doc/src/conf.py index aadb00e5..0476dcdb 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -1,3 +1,7 @@ +import os +import sys +sys.path.insert(0, os.path.abspath('../..')) + # -- Project information ----------------------------------------------------- import linkcheck.configuration diff --git a/doc/translations.md b/doc/translations.md index abdaf17c..92d6e4a0 100644 --- a/doc/translations.md +++ b/doc/translations.md @@ -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. diff --git a/pyproject.toml b/pyproject.toml index 7574e844..781a07ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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",