Date: Wednesday, November 30, 2022 @ 11:00:50
  Author: dvzrv
Revision: 1355398

upgpkg: python-binaryornot 0.4.4-7: Rebuild to fix various issues.

Switch to PEP517.
Remove unnecessary quotes and curly braces.
Switch to using unittest instead of relying on deprecated setuptools features.

Modified:
  python-binaryornot/trunk/PKGBUILD

----------+
 PKGBUILD |   51 ++++++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 29 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-11-30 10:30:50 UTC (rev 1355397)
+++ PKGBUILD    2022-11-30 11:00:50 UTC (rev 1355398)
@@ -3,48 +3,41 @@
 _name=binaryornot
 pkgname=python-binaryornot
 pkgver=0.4.4
-pkgrel=6
+pkgrel=7
 pkgdesc="Ultra-lightweight pure Python package to check if a file is binary or 
text"
-arch=('any')
+arch=(any)
 url="https://github.com/audreyr/binaryornot";
-license=('BSD')
-depends=('python-chardet')
-makedepends=('python-setuptools')
-checkdepends=('python-hypothesis' 'python-pytest')
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz";
-        
"${pkgname}-0.4.4-hypothesis_tests.patch::https://github.com/audreyr/binaryornot/pull/52.patch";)
+license=(BSD)
+depends=(python-chardet)
+makedepends=(python-build python-installer python-setuptools python-wheel)
+checkdepends=(python-hypothesis)
+source=(
+  
https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz
+  
$pkgname-0.4.4-hypothesis_tests.patch::https://github.com/audreyr/binaryornot/pull/52.patch
+)
 
sha512sums=('379e71b41824b9389ea02c64223e26c57694d07b749c197e3a6b9f10558c8d502e9b93a13ae6c3a4bca49064ffc650ce822073dc312fb06e50e06b8a3f04f419'
             
'8a0f1066a580f08778434ed7d30c2ebf2764dbfd746b561ffce2fb8dd8d77cafaf4a58b03504cf5b1e4d37e0a6ffe3038dcaa5611cdfd7d42ada86edd1e47f3f')
+b2sums=('4a70e22eba51a266987308e8d1b4571ace5760f945920194a1a61f4336f33dcb655c4f0b1f760aa3502834d29a1a64ac62657e5d73eac8f1d7d02edf71db8af9'
+        
'f07730709f11bf0732b60b81603c40bea1fa6da2d8df545b088072e0f710a7e123e438b03d2390122b6000c14343e932b38d4b6f8956ea87b72e29deae1a4715')
 
 prepare() {
-  mv -v "${_name}-${pkgver}" "$pkgname-$pkgver"
-  cd "$pkgname-$pkgver"
-  # fix tests using python-hypothesis:
-  # https://github.com/audreyr/binaryornot/issues/46
-  patch -Np1 -i "../${pkgname}-0.4.4-hypothesis_tests.patch"
+  # fix tests using python-hypothesis: 
https://github.com/audreyr/binaryornot/issues/46
+  patch -Np1 -d $_name-$pkgver -i ../$pkgname-0.4.4-hypothesis_tests.patch
 }
 
 build() {
-  cd "$pkgname-$pkgver"
-  python setup.py build
+  cd $_name-$pkgver
+  python -m build --wheel --no-isolation
 }
 
 check() {
-  cd "$pkgname-$pkgver"
-# tests can only be run via setuptools:
-# https://github.com/audreyr/binaryornot/issues/160
-#  export PYTHONPATH="build:${PYTHONPATH}"
-#  pytest -v
-  python setup.py test
+  cd $_name-$pkgver
+  python -m unittest discover -vs tests
 }
 
 package() {
-  cd "$pkgname-$pkgver"
-  python setup.py install --skip-build \
-    --optimize=1 \
-    --prefix=/usr \
-    --root="${pkgdir}"
-  install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
-  install -vDm 644 {AUTHORS,CONTRIBUTING,HISTORY,README}.rst \
-    -t "${pkgdir}/usr/share/doc/${pkgname}"
+  cd $_name-$pkgver
+  python -m installer --destdir="$pkgdir" dist/*.whl
+  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
+  install -vDm 644 {AUTHORS,CONTRIBUTING,HISTORY,README}.rst -t 
"$pkgdir/usr/share/doc/$pkgname/"
 }

Reply via email to