mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 07:17:17 +00:00
add manpage generator
This commit is contained in:
parent
c757554148
commit
8f55cc600e
2
.github/workflows/run-tests.yml
vendored
2
.github/workflows/run-tests.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
docker run \
|
docker run \
|
||||||
-v ${{ github.workspace }}:/build -w /build \
|
-v ${{ github.workspace }}:/build -w /build \
|
||||||
archlinux:latest \
|
archlinux:latest \
|
||||||
/bin/bash -c "pacman --noconfirm -Syu base-devel python python-pip && \
|
/bin/bash -c "pacman --noconfirm -Syu base-devel python-argparse-manpage python-pip && \
|
||||||
pip install -e .[web] && \
|
pip install -e .[web] && \
|
||||||
pip install -e .[check] && \
|
pip install -e .[check] && \
|
||||||
pip install -e .[s3] && \
|
pip install -e .[s3] && \
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -94,3 +94,5 @@ ENV/
|
|||||||
.venv/
|
.venv/
|
||||||
|
|
||||||
*.tar.xz
|
*.tar.xz
|
||||||
|
|
||||||
|
man/
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# ArcHlinux ReposItory MANager
|
# ArcHlinux ReposItory MANager
|
||||||
|
|
||||||
[](https://github.com/arcan1s/ahriman/actions/workflows/run-tests.yml)
|
[](https://github.com/arcan1s/ahriman/actions/workflows/run-tests.yml)
|
||||||
|
[](https://www.codefactor.io/repository/github/arcan1s/ahriman)
|
||||||
|
|
||||||
Wrapper for managing custom repository inspired by [repo-scripts](https://github.com/arcan1s/repo-scripts).
|
Wrapper for managing custom repository inspired by [repo-scripts](https://github.com/arcan1s/repo-scripts).
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ arch=('any')
|
|||||||
url="https://github.com/arcan1s/ahriman"
|
url="https://github.com/arcan1s/ahriman"
|
||||||
license=('GPL3')
|
license=('GPL3')
|
||||||
depends=('devtools' 'git' 'pyalpm' 'python-aur' 'python-srcinfo')
|
depends=('devtools' 'git' 'pyalpm' 'python-aur' 'python-srcinfo')
|
||||||
makedepends=('python-pip')
|
makedepends=('python-argparse-manpage' 'python-pip')
|
||||||
optdepends=('breezy: -bzr packages support'
|
optdepends=('breezy: -bzr packages support'
|
||||||
'darcs: -darcs packages support'
|
'darcs: -darcs packages support'
|
||||||
'gnupg: package and repository sign'
|
'gnupg: package and repository sign'
|
||||||
@ -22,9 +22,6 @@ optdepends=('breezy: -bzr packages support'
|
|||||||
source=("https://github.com/arcan1s/ahriman/releases/download/$pkgver/$pkgname-$pkgver-src.tar.xz"
|
source=("https://github.com/arcan1s/ahriman/releases/download/$pkgver/$pkgname-$pkgver-src.tar.xz"
|
||||||
'ahriman.sysusers'
|
'ahriman.sysusers'
|
||||||
'ahriman.tmpfiles')
|
'ahriman.tmpfiles')
|
||||||
sha512sums=('6ab741bfb42f92ab00d1b6ecfc44426c00e5c433486e014efbdb585715d9a12dbbafc280e5a9f85b941c8681b13a9dad41327a3e3c44a9683ae30c1d6f017f50'
|
|
||||||
'13718afec2c6786a18f0b223ef8e58dccf0688bca4cdbe203f14071f5031ed20120eb0ce38b52c76cfd6e8b6581a9c9eaa2743eb11abbaca637451a84c33f075'
|
|
||||||
'55b20f6da3d66e7bbf2add5d95a3b60632df121717d25a993e56e737d14f51fe063eb6f1b38bd81cc32e05db01c0c1d80aaa720c45cde87f238d8b46cdb8cbc4')
|
|
||||||
backup=('etc/ahriman.ini'
|
backup=('etc/ahriman.ini'
|
||||||
'etc/ahriman.ini.d/logging.ini')
|
'etc/ahriman.ini.d/logging.ini')
|
||||||
|
|
||||||
@ -42,3 +39,7 @@ package() {
|
|||||||
install -Dm644 "$srcdir/$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
|
install -Dm644 "$srcdir/$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
|
||||||
install -Dm644 "$srcdir/$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
|
install -Dm644 "$srcdir/$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sha512sums=('6ab741bfb42f92ab00d1b6ecfc44426c00e5c433486e014efbdb585715d9a12dbbafc280e5a9f85b941c8681b13a9dad41327a3e3c44a9683ae30c1d6f017f50'
|
||||||
|
'13718afec2c6786a18f0b223ef8e58dccf0688bca4cdbe203f14071f5031ed20120eb0ce38b52c76cfd6e8b6581a9c9eaa2743eb11abbaca637451a84c33f075'
|
||||||
|
'55b20f6da3d66e7bbf2add5d95a3b60632df121717d25a993e56e737d14f51fe063eb6f1b38bd81cc32e05db01c0c1d80aaa720c45cde87f238d8b46cdb8cbc4')
|
||||||
|
@ -3,3 +3,6 @@ test = pytest
|
|||||||
|
|
||||||
[tool:pytest]
|
[tool:pytest]
|
||||||
addopts = --cov=ahriman --cov-report term-missing:skip-covered --pspec
|
addopts = --cov=ahriman --cov-report term-missing:skip-covered --pspec
|
||||||
|
|
||||||
|
[build_manpages]
|
||||||
|
manpages = man/ahriman.1:module=ahriman.application.ahriman:function=_parser
|
||||||
|
23
setup.py
23
setup.py
@ -1,11 +1,16 @@
|
|||||||
from distutils.util import convert_path
|
from build_manpages.build_manpages import build_manpages, get_build_py_cmd, get_install_cmd
|
||||||
|
from pathlib import Path
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from os import path
|
from setuptools.command.build_py import build_py
|
||||||
|
from setuptools.command.install import install
|
||||||
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
|
||||||
|
metadata_path = Path(__file__).resolve().parent / "src/ahriman/version.py"
|
||||||
|
metadata: Dict[str, Any] = dict()
|
||||||
|
with metadata_path.open() as metadata_file:
|
||||||
|
exec(metadata_file.read(), metadata) # pylint: disable=exec-used
|
||||||
|
|
||||||
here = path.abspath(path.dirname(__file__))
|
|
||||||
metadata = dict()
|
|
||||||
with open(convert_path("src/ahriman/version.py")) as metadata_file:
|
|
||||||
exec(metadata_file.read(), metadata)
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="ahriman",
|
name="ahriman",
|
||||||
@ -96,4 +101,10 @@ setup(
|
|||||||
"aiohttp_jinja2",
|
"aiohttp_jinja2",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cmdclass={
|
||||||
|
"build_manpages": build_manpages,
|
||||||
|
"build_py": get_build_py_cmd(build_py),
|
||||||
|
"install": get_install_cmd(install),
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
@ -30,8 +30,7 @@ from ahriman.models.sign_settings import SignSettings
|
|||||||
|
|
||||||
|
|
||||||
# pylint thinks it is bad idea, but get the fuck off
|
# pylint thinks it is bad idea, but get the fuck off
|
||||||
# pylint: disable=protected-access
|
SubParserAction = argparse._SubParsersAction # pylint: disable=protected-access
|
||||||
SubParserAction = argparse._SubParsersAction
|
|
||||||
|
|
||||||
|
|
||||||
def _parser() -> argparse.ArgumentParser:
|
def _parser() -> argparse.ArgumentParser:
|
||||||
|
@ -53,8 +53,7 @@ class Client:
|
|||||||
:param status: current package build status
|
:param status: current package build status
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
def get(self, base: Optional[str]) -> List[Tuple[Package, BuildStatus]]: # pylint: disable=no-self-use
|
||||||
def get(self, base: Optional[str]) -> List[Tuple[Package, BuildStatus]]:
|
|
||||||
"""
|
"""
|
||||||
get package status
|
get package status
|
||||||
:param base: package base to get
|
:param base: package base to get
|
||||||
@ -63,16 +62,14 @@ class Client:
|
|||||||
del base
|
del base
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
def get_internal(self) -> InternalStatus: # pylint: disable=no-self-use
|
||||||
def get_internal(self) -> InternalStatus:
|
|
||||||
"""
|
"""
|
||||||
get internal service status
|
get internal service status
|
||||||
:return: current internal (web) service status
|
:return: current internal (web) service status
|
||||||
"""
|
"""
|
||||||
return InternalStatus()
|
return InternalStatus()
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
def get_self(self) -> BuildStatus: # pylint: disable=no-self-use
|
||||||
def get_self(self) -> BuildStatus:
|
|
||||||
"""
|
"""
|
||||||
get ahriman status itself
|
get ahriman status itself
|
||||||
:return: current ahriman status
|
:return: current ahriman status
|
||||||
|
@ -40,7 +40,7 @@ def exception_handler(logger: Logger) -> Callable[[Request, HandlerType], Awaita
|
|||||||
except HTTPClientError:
|
except HTTPClientError:
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception(f"exception during performing request to {request.path}")
|
logger.exception("exception during performing request to %s", request.path)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
return handle
|
return handle
|
||||||
|
@ -25,8 +25,7 @@ async def test_exception_handler_client_error(aiohttp_request: Any, mocker: Mock
|
|||||||
"""
|
"""
|
||||||
must pass client exception
|
must pass client exception
|
||||||
"""
|
"""
|
||||||
request_handler = AsyncMock()
|
request_handler = AsyncMock(side_effect=HTTPBadRequest())
|
||||||
request_handler.side_effect = HTTPBadRequest()
|
|
||||||
logging_mock = mocker.patch("logging.Logger.exception")
|
logging_mock = mocker.patch("logging.Logger.exception")
|
||||||
|
|
||||||
handler = exception_handler(logging.getLogger())
|
handler = exception_handler(logging.getLogger())
|
||||||
@ -39,8 +38,7 @@ async def test_exception_handler_server_error(aiohttp_request: Any, mocker: Mock
|
|||||||
"""
|
"""
|
||||||
must log server exception and re-raise it
|
must log server exception and re-raise it
|
||||||
"""
|
"""
|
||||||
request_handler = AsyncMock()
|
request_handler = AsyncMock(side_effect=Exception())
|
||||||
request_handler.side_effect = Exception()
|
|
||||||
logging_mock = mocker.patch("logging.Logger.exception")
|
logging_mock = mocker.patch("logging.Logger.exception")
|
||||||
|
|
||||||
handler = exception_handler(logging.getLogger())
|
handler = exception_handler(logging.getLogger())
|
||||||
|
Loading…
Reference in New Issue
Block a user