[arch-commits] Commit in python-nose/trunk (PKGBUILD)

Felix Yan felixonmars at gemini.archlinux.org
Mon Jan 3 14:47:36 UTC 2022


    Date: Monday, January 3, 2022 @ 14:47:35
  Author: felixonmars
Revision: 433333

upgpkg: python-nose 1.3.7-14: fix nose for setuptools 58+

Modified:
  python-nose/trunk/PKGBUILD

----------+
 PKGBUILD |   28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-01-03 13:22:00 UTC (rev 433332)
+++ PKGBUILD	2022-01-03 14:47:35 UTC (rev 433333)
@@ -5,7 +5,7 @@
 
 pkgname=python-nose
 pkgver=1.3.7
-pkgrel=13
+pkgrel=14
 pkgdesc="A discovery-based unittest extension"
 arch=('any')
 url='https://readthedocs.org/docs/nose/'
@@ -16,13 +16,29 @@
             'SKIP')
 validpgpkeys=('58B277C0D208F7AC460C07C84548B3A8C0D70C12') # John Szakmeister <john at szakmeister.net>
 
-build() {
-  cd "$srcdir/nose-$pkgver"
+prepare() {
+  cd nose-$pkgver
   sed -i -e "s:man/man1:share/man/man1:g" setup.py
+
+  # setuptools 58 removed support for 2to3
+  sed -i "s/'use_2to3': True,//" setup.py
+  sed -i 's/from setuptools.command.build_py import Mixin2to3/from distutils.util import Mixin2to3/' setup3lib.py
+  sed -i 's/except ImportError:/except IOError:/' setup.py
 }
 
+build() {
+  cd nose-$pkgver
+  2to3 -wn nose unit_tests functional_tests
+  python setup.py build build_tests
+}
+
+check() {
+  cd nose-$pkgver
+  python selftest.py || echo "Tests failed"
+}
+
 package() {
-  cd "$srcdir/nose-$pkgver"
-  python3 setup.py install --prefix=/usr --root="${pkgdir}"
-  ln -s nosetests "$pkgdir/usr/bin/nosetests3"
+  cd nose-$pkgver
+  python setup.py install --prefix=/usr --root="$pkgdir"
+  ln -s nosetests "$pkgdir"/usr/bin/nosetests3
 }



More information about the arch-commits mailing list