mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-03-04 01:09:48 +00:00
This was initally generated by ai, but later has been heavily edited. The reason why it has been implemented is that there are plans to implement more features to ui, but it becomes hard to add new features to plain js, so I decided to rewrite it in typescript. Yet because it is still ai slop, it is still possible to enable old interface via configuration, even though new interface is turned on by default to get feedback
350 lines
7.1 KiB
TOML
350 lines
7.1 KiB
TOML
env_list = [
|
|
"check",
|
|
"tests",
|
|
]
|
|
isolated_build = true
|
|
labels.release = [
|
|
"version",
|
|
"docs",
|
|
"publish",
|
|
]
|
|
|
|
[commands]
|
|
npm_install = [
|
|
[
|
|
"npm",
|
|
{ replace = "ref", of = ["flags", "npm"], extend = true },
|
|
"install",
|
|
"--cache", "{envtmpdir}/npm-cache",
|
|
],
|
|
]
|
|
|
|
[flags]
|
|
autopep8 = [
|
|
"--max-line-length", "120",
|
|
"-aa",
|
|
]
|
|
bandit = [
|
|
"--configfile", ".bandit.yml",
|
|
]
|
|
manpage = [
|
|
"--author", "{[project]name} team",
|
|
"--author-email", "",
|
|
"--description", "ArcH linux ReposItory MANager",
|
|
"--manual-title", "ArcH linux ReposItory MANager",
|
|
"--project-name", "{[project]name}",
|
|
"--version", "{env:VERSION}",
|
|
"--url", "https://github.com/arcan1s/ahriman",
|
|
]
|
|
mypy = [
|
|
"--implicit-reexport",
|
|
"--strict",
|
|
"--allow-untyped-decorators",
|
|
"--allow-subclassing-any",
|
|
]
|
|
npm = [
|
|
"--prefix", "frontend",
|
|
]
|
|
pydeps = [
|
|
"--no-config",
|
|
"--cluster",
|
|
]
|
|
pylint = [
|
|
"--rcfile", ".pylint.toml",
|
|
]
|
|
shtab = [
|
|
"--prefix", "{[project]name}",
|
|
"--prog", "{[project]name}",
|
|
"ahriman.application.ahriman._parser",
|
|
]
|
|
|
|
[project]
|
|
extras = [
|
|
"journald",
|
|
"pacman",
|
|
"reports",
|
|
"s3",
|
|
"shell",
|
|
"stats",
|
|
"unixsocket",
|
|
"validator",
|
|
"web",
|
|
"web-auth",
|
|
"web-docs",
|
|
"web-oauth2",
|
|
"web-metrics",
|
|
]
|
|
name = "ahriman"
|
|
|
|
[env.archive]
|
|
description = "Create source files tarball"
|
|
deps = [
|
|
"build",
|
|
]
|
|
commands = [
|
|
[
|
|
"{envpython}",
|
|
"-m", "build",
|
|
"--sdist",
|
|
],
|
|
]
|
|
|
|
[env.check]
|
|
description = "Run common checks like linter, mypy, etc"
|
|
allowlist_externals = [
|
|
"npm",
|
|
]
|
|
dependency_groups = [
|
|
"check",
|
|
]
|
|
extras = [
|
|
{ replace = "ref", of = ["project", "extras"], extend = true },
|
|
]
|
|
pip_pre = true
|
|
set_env.CFLAGS = "-Wno-unterminated-string-initialization"
|
|
set_env.MYPYPATH = "src"
|
|
commands = [
|
|
[
|
|
"autopep8",
|
|
{ replace = "ref", of = ["flags", "autopep8"], extend = true },
|
|
"--exit-code",
|
|
"--in-place",
|
|
"--jobs", "0",
|
|
"--recursive",
|
|
"src/{[project]name}",
|
|
"tests/{[project]name}",
|
|
],
|
|
[
|
|
"pylint",
|
|
{ replace = "ref", of = ["flags", "pylint"], extend = true },
|
|
"src/{[project]name}",
|
|
],
|
|
[
|
|
"bandit",
|
|
{ replace = "ref", of = ["flags", "bandit"], extend = true },
|
|
"--recursive",
|
|
"src/{[project]name}",
|
|
],
|
|
[
|
|
"bandit",
|
|
{ replace = "ref", of = ["flags", "bandit"], extend = true },
|
|
"--skip", "B101,B105,B106",
|
|
"--recursive",
|
|
"src/{[project]name}",
|
|
],
|
|
[
|
|
"mypy",
|
|
{ replace = "ref", of = ["flags", "mypy"], extend = true },
|
|
"--install-types",
|
|
"--non-interactive",
|
|
"--package", "{[project]name}",
|
|
],
|
|
{ replace = "ref", of = ["commands", "npm_install"], extend = true },
|
|
[
|
|
"npm",
|
|
{ replace = "ref", of = ["flags", "npm"], extend = true },
|
|
"run",
|
|
"lint",
|
|
],
|
|
]
|
|
|
|
[env.docs]
|
|
description = "Generate source files for documentation"
|
|
dependency_groups = [
|
|
"docs",
|
|
]
|
|
depends = [
|
|
"version",
|
|
]
|
|
deps = [
|
|
"uv",
|
|
]
|
|
dynamic_version = "{[project]name}.__version__"
|
|
extras = [
|
|
{ replace = "ref", of = ["project", "extras"], extend = true },
|
|
]
|
|
pip_pre = true
|
|
set_env.PYTHONPATH = "src"
|
|
set_env.SPHINX_APIDOC_OPTIONS = "members,no-undoc-members,show-inheritance"
|
|
commands = [
|
|
[
|
|
"shtab",
|
|
{ replace = "ref", of = ["flags", "shtab"], extend = true },
|
|
"--shell", "bash",
|
|
"--output", "package/share/bash-completion/completions/_ahriman",
|
|
],
|
|
[
|
|
"shtab",
|
|
{ replace = "ref", of = ["flags", "shtab"], extend = true },
|
|
"--shell", "zsh",
|
|
"--output", "package/share/zsh/site-functions/_ahriman",
|
|
],
|
|
[
|
|
"argparse-manpage",
|
|
{ replace = "ref", of = ["flags", "manpage"], extend = true },
|
|
"--module", "ahriman.application.ahriman",
|
|
"--function", "_parser",
|
|
"--output", "package/share/man/man1/ahriman.1",
|
|
],
|
|
[
|
|
"pydeps",
|
|
{ replace = "ref", of = ["flags", "pydeps"], extend = true },
|
|
"--dot-output", "{tox_root}/docs/_static/architecture.dot",
|
|
"--no-output",
|
|
"--show-dot",
|
|
"src/ahriman",
|
|
],
|
|
[
|
|
"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",
|
|
],
|
|
]
|
|
|
|
[env.frontend]
|
|
description = "Build frontend HTML and JS"
|
|
allowlist_externals = [
|
|
"npm",
|
|
]
|
|
commands = [
|
|
{ replace = "ref", of = ["commands", "npm_install"], extend = true },
|
|
[
|
|
"npm",
|
|
{ replace = "ref", of = ["flags", "npm"], extend = true },
|
|
"run",
|
|
"build",
|
|
],
|
|
]
|
|
|
|
[env.html]
|
|
description = "Generate html documentation"
|
|
dependency_groups = [
|
|
"docs",
|
|
]
|
|
extras = [
|
|
{ replace = "ref", of = ["project", "extras"], extend = true },
|
|
]
|
|
pip_pre = true
|
|
recreate = true
|
|
commands = [
|
|
[
|
|
"sphinx-build",
|
|
"--builder", "html",
|
|
"--fail-on-warning",
|
|
"--jobs", "auto",
|
|
"--write-all",
|
|
"docs",
|
|
"{envtmpdir}/html",
|
|
],
|
|
]
|
|
|
|
[env.publish]
|
|
description = "Create and publish release to GitHub"
|
|
allowlist_externals = [
|
|
"git",
|
|
]
|
|
depends = [
|
|
"docs",
|
|
]
|
|
pass_env = [
|
|
"SSH_AUTH_SOCK",
|
|
]
|
|
commands = [
|
|
[
|
|
"git",
|
|
"add",
|
|
"package/archlinux/PKGBUILD",
|
|
"src/ahriman/__init__.py",
|
|
"docs/_static/architecture.dot",
|
|
"package/share/man/man1/ahriman.1",
|
|
"package/share/bash-completion/completions/_ahriman",
|
|
"package/share/zsh/site-functions/_ahriman",
|
|
],
|
|
[
|
|
"git",
|
|
"commit",
|
|
"--message", "Release {posargs}",
|
|
],
|
|
[
|
|
"git",
|
|
"tag",
|
|
"{posargs}",
|
|
],
|
|
[
|
|
"git",
|
|
"push",
|
|
],
|
|
[
|
|
"git",
|
|
"push",
|
|
"--tags",
|
|
],
|
|
]
|
|
|
|
[env.tests]
|
|
description = "Run tests"
|
|
dependency_groups = [
|
|
"tests",
|
|
]
|
|
extras = [
|
|
{ replace = "ref", of = ["project", "extras"], extend = true },
|
|
]
|
|
pip_pre = true
|
|
set_env.CFLAGS = "-Wno-unterminated-string-initialization"
|
|
commands = [
|
|
[
|
|
"pytest",
|
|
{ replace = "posargs", extend = true },
|
|
],
|
|
]
|
|
|
|
[env.version]
|
|
description = "Bump package version"
|
|
allowlist_externals = [
|
|
"npm",
|
|
"sed",
|
|
]
|
|
deps = [
|
|
"packaging",
|
|
]
|
|
commands = [
|
|
# check if version is set and validate it
|
|
[
|
|
"{envpython}",
|
|
"-c", "from packaging.version import Version; Version('{posargs}')",
|
|
],
|
|
[
|
|
"sed",
|
|
"--in-place",
|
|
"s/^__version__ = .*/__version__ = \"{posargs}\"/",
|
|
"src/ahriman/__init__.py",
|
|
],
|
|
[
|
|
"npm",
|
|
{ replace = "ref", of = ["flags", "npm"], extend = true },
|
|
"version",
|
|
"{posargs}",
|
|
],
|
|
[
|
|
"sed",
|
|
"--in-place",
|
|
"s/pkgver=.*/pkgver={posargs}/",
|
|
"package/archlinux/PKGBUILD",
|
|
],
|
|
]
|