From 89d8227ba6f42c4f5e0461552755aa7b493cfb7d Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Sun, 13 Oct 2024 23:04:00 +0300 Subject: [PATCH] Revert "use hatchling instead of flit" This reverts commit d18d146d796bef01f7bba9003bc634946649f9aa. --- Dockerfile | 2 +- package/archlinux/PKGBUILD | 25 ++++++++++--------------- pyproject.toml | 19 +++++-------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index db8c806e..61fdc8ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ RUN pacman -S --noconfirm --asdeps \ pacman -S --noconfirm --asdeps \ base-devel \ python-build \ - python-hatchling \ + python-flit \ python-installer \ python-wheel \ && \ diff --git a/package/archlinux/PKGBUILD b/package/archlinux/PKGBUILD index b9ee5811..4e093d24 100644 --- a/package/archlinux/PKGBUILD +++ b/package/archlinux/PKGBUILD @@ -8,7 +8,7 @@ arch=('any') url="https://github.com/arcan1s/ahriman" license=('GPL3') depends=('devtools>=1:1.0.0' 'git' 'pyalpm' 'python-bcrypt' 'python-inflection' 'python-pyelftools' 'python-requests') -makedepends=('python-build' 'python-hatchling' 'python-installer' 'python-wheel') +makedepends=('python-build' 'python-flit' 'python-installer' 'python-wheel') optdepends=('python-aioauth-client: web server with OAuth2 authorization' 'python-aiohttp: web server' 'python-aiohttp-apispec>=3.0.0: web server' @@ -32,25 +32,20 @@ backup=('etc/ahriman.ini' 'etc/ahriman.ini.d/logging.ini') build() { - cd "$pkgname-$pkgver" + cd "$pkgname-$pkgver" - python -m build --wheel --no-isolation + python -m build --wheel --no-isolation } package() { - cd "$pkgname-$pkgver" + cd "$pkgname-$pkgver" - python -m installer --destdir="$pkgdir" "dist/$pkgname-$pkgver-py3-none-any.whl" + python -m installer --destdir="$pkgdir" "dist/$pkgname-$pkgver-py3-none-any.whl" - # hatchling doesn't support installation outside of the python root, so we need to install data files manually - local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") - cp -a "$pkgdir$site_packages/$pkgname/data/"* "$pkgdir/usr/" - rm -r "$pkgdir$site_packages/$pkgname/data" + # keep usr/share configs as reference and copy them to /etc + install -Dm644 "$pkgdir/usr/share/$pkgname/settings/ahriman.ini" "$pkgdir/etc/ahriman.ini" + install -Dm644 "$pkgdir/usr/share/$pkgname/settings/ahriman.ini.d/logging.ini" "$pkgdir/etc/ahriman.ini.d/logging.ini" - # keep usr/share configs as reference and copy them to /etc - install -Dm644 "$pkgdir/usr/share/$pkgname/settings/ahriman.ini" "$pkgdir/etc/ahriman.ini" - install -Dm644 "$pkgdir/usr/share/$pkgname/settings/ahriman.ini.d/logging.ini" "$pkgdir/etc/ahriman.ini.d/logging.ini" - - 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.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + install -Dm644 "$srcdir/$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" } diff --git a/pyproject.toml b/pyproject.toml index 4e591d7a..5124c97d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["flit_core"] +build-backend = "flit_core.buildapi" [project] name = "ahriman" @@ -89,26 +89,17 @@ web = [ "setuptools", # required by aiohttp-apispec ] -[tool.hatch.version] -path = "src/ahriman/__init__.py" - -[tool.hatch.build.targets.sdist] +[tool.flit.sdist] include = [ "AUTHORS", "CONTRIBUTING.md", "SECURITY.md", "package", - "src", "web.png", ] exclude = [ "package/archlinux", ] -[tool.hatch.build.targets.wheel] -packages = [ - "src/ahriman", -] - -[tool.hatch.build.targets.wheel.force-include] -"package" = "ahriman/data" +[tool.flit.external-data] +directory = "package"