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

David Runge dvzrv at gemini.archlinux.org
Tue Jul 19 21:02:15 UTC 2022


    Date: Tuesday, July 19, 2022 @ 21:02:15
  Author: dvzrv
Revision: 1254744

upgpkg: python-nose2 0.12.0-1: Upgrade to 0.12.0.

Devendor python-six.
Install to temporary location to run tests with nose2.
Switch to PEP517.

Modified:
  python-nose2/trunk/PKGBUILD

----------+
 PKGBUILD |   46 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 14 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-07-19 21:01:20 UTC (rev 1254743)
+++ PKGBUILD	2022-07-19 21:02:15 UTC (rev 1254744)
@@ -2,7 +2,7 @@
 
 _name=nose2
 pkgname=python-nose2
-pkgver=0.11.0
+pkgver=0.12.0
 pkgrel=1
 pkgdesc="The next generation of nicer testing for python"
 arch=(any)
@@ -9,26 +9,44 @@
 url="https://github.com/nose-devs/nose2"
 license=(BSD)
 depends=(python-coverage python-six)
-makedepends=(python-setuptools)
-optdepends=('python-coverage: for coverage_plugin'
-            'python-setuptools: for eggdiscovery plugin'
-            'python-sphinx: for doc'
-            'python-sphinx_rtd_theme: for doc'
-            'python-mock: for doc')
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
-sha512sums=('5210098d9096a14a8c3565531d4404da4d2aa2b5b4d5e2d5cd3b9262c112281bb5b08deed1ac6a1a6c04f876702d9de32ae148498a3743bcbc03917cee8d09b2')
-b2sums=('2625a4cc30de8a40c7c36bd6c7fe0df8f9a32217e0f3c2694dac1226056f3cbc85ab58b2daa7a9903ea1f01a2bcdf5ea8ae113a33d8902034c04ab2f56af0852')
+makedepends=(python-build python-installer python-setuptools python-wheel)
+optdepends=(
+  'python-coverage: for coverage_plugin'
+  'python-setuptools: for eggdiscovery plugin'
+  'python-sphinx: for doc'
+  'python-sphinx_rtd_theme: for doc'
+  'python-mock: for doc'
+)
+source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
+sha512sums=('73ddcf62af6db7c1b34fef733d8efc4bd223470cdac3983c483a08625dbb06c18dd6e3418ebbf85db7497cf05ab22c08653b3a65973212c158a27590265b738f')
+b2sums=('834a9b2ad09d3e411b5e80a9eaa05204a1f3d0ea43feee2240498c1642e9039e3b0a510ec5cf1c2e81c510b8975430a81302f305a23345bd504fea0d860318e5')
 
+prepare() {
+  # devendor python-six
+  find $_name-$pkgver -type f -iname "*.py" -exec sed -e 's/from nose2._vendor //' -i {} +
+  rm -frv $_name-$pkgver/$_name/_vendor
+}
+
 build() {
   cd $_name-$pkgver
-  python setup.py build
+  python -m build --wheel --no-isolation
 }
 
+check() {
+  local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+  local _test_dir="$PWD/test_dir"
+
+  cd $_name-$pkgver
+  # install to temporary location to be able to run tests with nose2 itself
+  python -m installer --destdir="$_test_dir" dist/*.whl
+  export PYTHONPATH="$_test_dir/$_site_packages:$PYTHONPATH"
+  cd "$_test_dir/$_site_packages/nose2"
+  PATH="$_test_dir/usr/bin:$PATH" nose2 -v --start-dir tests/unit
+}
+
 package() {
   cd $_name-$pkgver
-  python setup.py install --optimize=1 --root="$pkgdir"
-  # license
+  python -m installer --destdir="$pkgdir" dist/*.whl
   install -vDm 644 license.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
-  # docs
   install -vDm 644 {AUTHORS,README.rst} -t "$pkgdir/usr/share/doc/$pkgname/"
 }



More information about the arch-commits mailing list