mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-07-17 16:21:07 +00:00
build: subpackages implementation (#164)
* migrate to hatch * reorder tests * generic fixtures * straight forward conftest * fix docs generation * fix tox environments * reformat tomls * cleanup pyproject * some play with renaming * move root conftest into pytest plugins * fix setup script * move fixtures to __init__.py * remove duplicate fixtures * disable pylint warning * simplify configuration fixture * remove empty conftest * remove crap from local pyprojects
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
[tool.bandit]
|
||||
skips = [
|
||||
"B404",
|
||||
"B603",
|
||||
]
|
||||
@@ -1,3 +0,0 @@
|
||||
skips:
|
||||
- B404
|
||||
- B603
|
||||
@@ -12,7 +12,7 @@ pacman -Syyu --noconfirm
|
||||
# main dependencies
|
||||
pacman -S --noconfirm devtools git npm pyalpm python-bcrypt python-filelock python-inflection python-pyelftools python-requests python-systemd sudo
|
||||
# make dependencies
|
||||
pacman -S --noconfirm --asdeps base-devel python-build python-flit python-installer python-tox python-wheel
|
||||
pacman -S --noconfirm --asdeps base-devel python-build python-hatchling python-installer python-tox python-wheel
|
||||
# optional dependencies
|
||||
if [[ -z $MINIMAL_INSTALL ]]; then
|
||||
# web server
|
||||
@@ -26,10 +26,10 @@ cp "docker/systemd-nspawn.sh" "/usr/local/bin/systemd-nspawn"
|
||||
# create fresh tarball
|
||||
tox -e archive
|
||||
# run makepkg
|
||||
PKGVER=$(python -c "from src.ahriman import __version__; print(__version__)")
|
||||
mv "dist/ahriman-$PKGVER.tar.gz" package/archlinux
|
||||
chmod +777 package/archlinux # because fuck you that's why
|
||||
cd package/archlinux
|
||||
PKGVER=$(PYTHONPATH=ahriman-core/src python -c "from ahriman import __version__; print(__version__)")
|
||||
mv "dist/ahriman-$PKGVER.tar.gz" archlinux
|
||||
chmod +777 archlinux # because fuck you that's why
|
||||
cd archlinux
|
||||
sudo -u nobody -- makepkg -cf --skipchecksums --noconfirm
|
||||
sudo -u nobody -- makepkg --packagelist | grep "ahriman-core-$PKGVER" | pacman -U --noconfirm --nodeps -
|
||||
if [[ -z $MINIMAL_INSTALL ]]; then
|
||||
|
||||
+5
-2
@@ -103,5 +103,8 @@ docs/html/
|
||||
# Frontend
|
||||
node_modules/
|
||||
package-lock.json
|
||||
package/share/ahriman/templates/static/index.js
|
||||
package/share/ahriman/templates/static/index.css
|
||||
ahriman-web/package/share/ahriman/templates/static/index.js
|
||||
ahriman-web/package/share/ahriman/templates/static/index.css
|
||||
|
||||
# local configs
|
||||
/*.ini
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[pytest]
|
||||
addopts = --cov=ahriman --cov-report=term-missing:skip-covered --no-cov-on-fail --cov-fail-under=100 --spec
|
||||
asyncio_default_fixture_loop_scope = function
|
||||
asyncio_mode = auto
|
||||
spec_test_format = {result} {docstring_summary}
|
||||
@@ -0,0 +1,8 @@
|
||||
[pytest]
|
||||
addopts = [
|
||||
"--spec",
|
||||
]
|
||||
asyncio_default_fixture_loop_scope = "function"
|
||||
asyncio_mode = "auto"
|
||||
"resource-path.directory-name-test-resources" = "../../tests/testresources"
|
||||
spec_test_format = "{result} {docstring_summary}"
|
||||
@@ -0,0 +1,64 @@
|
||||
[build-system]
|
||||
requires = [
|
||||
"hatchling",
|
||||
]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "ahriman-core"
|
||||
dependencies = [
|
||||
"bcrypt",
|
||||
"filelock",
|
||||
"inflection",
|
||||
"pyelftools",
|
||||
"requests",
|
||||
]
|
||||
description = "ArcH linux ReposItory MANager, core package"
|
||||
dynamic = [
|
||||
"version",
|
||||
]
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[project.optional-dependencies]
|
||||
journald = [
|
||||
"systemd-python",
|
||||
]
|
||||
# FIXME technically this dependency is required, but in some cases we do not have access to
|
||||
# the libalpm which is required in order to install the package. Thus in case if we do not
|
||||
# really need to run the application we can move it to "optional" dependencies
|
||||
pacman = [
|
||||
"pyalpm",
|
||||
]
|
||||
reports = [
|
||||
"Jinja2",
|
||||
]
|
||||
s3 = [
|
||||
"boto3",
|
||||
]
|
||||
shell = [
|
||||
"IPython",
|
||||
]
|
||||
stats = [
|
||||
"matplotlib",
|
||||
]
|
||||
unixsocket = [
|
||||
"requests-unixsocket2", # required by unix socket support
|
||||
]
|
||||
validator = [
|
||||
"cerberus",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
ahriman = "ahriman.application.ahriman:run"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = [
|
||||
"src/ahriman",
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel.shared-data]
|
||||
"package/lib" = "lib"
|
||||
"package/share" = "share"
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "src/ahriman/__init__.py"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user