docs: extract version for the manpage

This commit is contained in:
2025-06-23 18:51:25 +03:00
parent 7769a4a6e0
commit 5b0a8eeb07
7 changed files with 106 additions and 29 deletions

44
tox.ini
View File

@ -1,15 +1,30 @@
[tox]
envlist = check, tests
envlist =
check
tests
isolated_build = true
labels =
release = version, docs, publish
dependencies = -e .[journald,pacman,reports,s3,shell,stats,unixsocket,validator,web,web_api-docs,web_auth,web_oauth2,web_metrics]
extras =
journald
pacman
reports
s3
shell
stats
unixsocket
validator
web
web-auth
web-docs
web-oauth2
web-metrics
project_name = ahriman
[flags]
autopep8 = --max-line-length 120 -aa --in-place
bandit = --configfile .bandit.yml
manpage = --author "ahriman team" --author-email "" --description "ArcH linux ReposItory MANager" --manual-title "ArcH linux ReposItory MANager" --project-name ahriman --url https://github.com/arcan1s/ahriman
manpage = --author "ahriman team" --author-email "" --description "ArcH linux ReposItory MANager" --manual-title "ArcH linux ReposItory MANager" --project-name ahriman --version {env:VERSION} --url https://github.com/arcan1s/ahriman
mypy = --implicit-reexport --strict --allow-untyped-decorators --allow-subclassing-any
pydeps = --no-config --cluster
pylint = --rcfile .pylint.toml
@ -32,8 +47,8 @@ commands =
description = Run common checks like linter, mypy, etc
dependency_groups =
check
deps =
{[tox]dependencies}
extras =
{[tox]extras}
pip_pre = true
setenv =
CFLAGS="-Wno-unterminated-string-initialization"
@ -49,26 +64,25 @@ commands =
description = Generate source files for documentation
allowlist_externals =
bash
find
dependency_groups =
docs
depends =
version
deps =
{[tox]dependencies}
uv
extras =
{[tox]extras}
pip_pre = true
setenv =
PYTHONPATH=src
SPHINX_APIDOC_OPTIONS=members,no-undoc-members,show-inheritance
dynamic_version = ahriman.__version__
commands =
bash -c 'shtab {[flags]shtab} --shell bash > package/share/bash-completion/completions/_ahriman'
bash -c 'shtab {[flags]shtab} --shell zsh > package/share/zsh/site-functions/_ahriman'
argparse-manpage {[flags]manpage} --module ahriman.application.ahriman --function _parser --output ../package/share/man/man1/ahriman.1
argparse-manpage {[flags]manpage} --module ahriman.application.ahriman --function _parser --output package/share/man/man1/ahriman.1
pydeps {[flags]pydeps} --no-output --show-dot --dot-output {tox_root}{/}docs/_static/architecture.dot src/ahriman
# remove autogenerated modules rst files
find docs -type f -name "{[tox]project_name}*.rst" -delete
sphinx-apidoc --output-dir docs src
sphinx-apidoc --force --no-toc --output-dir docs src
# compile list of dependencies for rtd.io
uv pip compile --group pyproject.toml:docs --extra s3 --extra validator --extra web --output-file docs/requirements.txt --quiet pyproject.toml
@ -76,8 +90,8 @@ commands =
description = Generate html documentation
dependency_groups =
docs
deps =
{[tox]dependencies}
extras =
{[tox]extras}
pip_pre = true
recreate = true
commands =
@ -102,8 +116,8 @@ commands =
description = Run tests
dependency_groups =
tests
deps =
{[tox]dependencies}
extras =
{[tox]extras}
pip_pre = true
setenv =
CFLAGS="-Wno-unterminated-string-initialization"