--- PKGBUILD 2023-04-15 12:49:41.348812046 +0200 +++ PKGBUILD 2023-04-15 18:16:14.166017978 +0200 @@ -3,7 +3,7 @@ pkgname=pifpaf pkgver=3.1.5 _commit=d5e33872c3c2ef3067da6e1150c3f050f4a7b620 -pkgrel=6 +pkgrel=7 pkgdesc='Suite of tools and fixtures to manage daemons for testing' arch=('any') license=('Apache') @@ -13,31 +13,45 @@ provides=("python-pifpaf=$pkgver") conflicts=('python-pifpaf') replaces=('python-pifpaf') -makedepends=('git' 'python-setuptools') +makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools') checkdepends=('python-testrepository' 'python-requests' 'python-testtools' 'python-oslotest' 'memcached' 'percona-server' 'percona-server-clients' 'postgresql' 'redis' 'consul' 'couchdb' 'httpbin' 'rabbitmq') -source=("git+https://github.com/jd/pifpaf.git#commit=$_commit") -sha512sums=('SKIP') +source=( + "git+https://github.com/jd/pifpaf.git#commit=$_commit" + "redis_fix.diff" # redis since 6.2 needs "sentinel resolve-hostnames yes" in config to resolve localhost + "mysql_fix.diff" # secure-file-priv config +) +sha512sums=( + 'SKIP' + '1f7b1aab3e537bd37432daef7a6002260d2932232c1f67ecdc46035b46ed816a4ce809d86909de37c9a54c7dc80f86de1931dc37bca421ce52b52b8ed9b70b25' + '8cee4b3a7af6b42ce86308906dfc162cfd153d428b783613dc1edb7946f10cf11a6b3849fcdf1a6342baa10938031b851f73894594e44d14e7c5dcc08fa05139' +) + +prepare() { + cd "${pkgname}" + git cherry-pick -n b7acead84c08417089b22ca9629726453fd3f81f # Add pyproject.toml + git cherry-pick -n 7da8faf5810cf1c4ed7153c99e1b392b5a4205e9 # Rename deprecated keys in setup.cfg + git apply "${srcdir}/redis_fix.diff" + git apply "${srcdir}/mysql_fix.diff" +} build() { - cd pifpaf - python setup.py build + cd "${pkgname}" + python -m build --wheel } check() { # Hack entry points by installing it - cd pifpaf - python setup.py install --root="$PWD/tmp_install" --optimize=1 - local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") - # TODO: fix test failures - PYTHONPATH="$PWD/tmp_install/$site_packages" \ - PATH="$PWD/tmp_install/usr/bin:$PATH" \ - python setup.py testr || echo "Tests failed" + cd "${pkgname}" + python -m installer --destdir="${PWD}/tmp_install" dist/*.whl + PYTHONPATH="${PWD}" \ + PATH="${PWD}/tmp_install/usr/bin:$PATH" \ + python -m unittest discover "${pkgname}.tests" "test_*" "$PWD" } package() { - cd pifpaf - python setup.py install --root="$pkgdir" --optimize=1 + cd "${pkgname}" + python -m installer --destdir="${pkgdir}" dist/*.whl }