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

David Runge dvzrv at archlinux.org
Fri Jul 10 09:49:54 UTC 2020


    Date: Friday, July 10, 2020 @ 09:49:54
  Author: dvzrv
Revision: 663075

upgpkg: python-coverage 5.2-1: Upgrading to 5.2.

Removing the tests for python2-coverage as they would require packaging python2-hypothesis again.
Simplifying the source directory handling (copying is not required, as the interpreters can
build and test next to one another just fine).
Skip build when installing in package_*().
Adding python{,2}-setuptools to depends as the packages have entry_points.
Adding python{,2}-toml as optdepends for pyproject.toml support.

Modified:
  python-coverage/trunk/PKGBUILD

----------+
 PKGBUILD |   77 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 37 insertions(+), 40 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-10 09:49:31 UTC (rev 663074)
+++ PKGBUILD	2020-07-10 09:49:54 UTC (rev 663075)
@@ -4,68 +4,65 @@
 
 pkgbase=python-coverage
 pkgname=(python-coverage python2-coverage)
-pkgver=4.5.4
-pkgrel=3
+pkgver=5.2
+pkgrel=1
 pkgdesc="A tool for measuring code coverage of Python programs"
 arch=('x86_64')
 url="https://nedbatchelder.com/code/coverage/"
 license=('Apache')
 makedepends=('python-setuptools' 'python2-setuptools')
-checkdepends=('python-mock' 'python2-mock' 'python-pytest-xdist' 'python2-pytest-xdist'
-              'python-pycontracts' 'python2-pycontracts' 'python-greenlet' 'python2-greenlet'
-              'python-virtualenv' 'python2-virtualenv' 'python-pyenchant' 'python2-pyenchant'
-              'python-pylint' 'python2-pylint' 'python-unittest-mixins' 'python2-unittest-mixins'
-              'python-flaky' 'python2-flaky')
+checkdepends=('python-flaky' 'python-hypothesis' 'python-mock'
+'python-pycontracts' 'python-pytest' 'python-pytest-xdist' 'python-toml'
+'python-unittest-mixins' 'python-virtualenv')
 source=("$pkgbase-$pkgver.tar.gz::https://github.com/nedbat/coveragepy/archive/coverage-$pkgver.tar.gz")
-sha512sums=('4d7530607fbee436fb9ccb2f916175045ce8a2199d7ff09b5e9457cb2c6fc9c64f0f2d045176c38d528c0a80c0f7ba59f620158b25a4dac6aa18837178daaab3')
+sha512sums=('c6fc1e587586ed8e33f8b37064f56f7f736b9b2f81dd94ffd33ceb9b7f12cd5571c2f99c4cd281ce30f4654d2c9d5fee21f51978a173293f670aa70799a3e9ec')
+b2sums=('3d741f1606d28382cc3acfeada05fad1e8d715925ebdca326def2590d9505effb01c9fcb2ed9b7ece30ba199d3e6dfd3e35f2f30cee7c15d6b69af6f01dad555')
 
 prepare() {
-  mv coveragepy-coverage-$pkgver coveragepy-$pkgver
-  cp -a coveragepy-$pkgver{,-py2}
+  mv -v "coveragepy-coverage-$pkgver" "${pkgbase}-$pkgver"
 }
 
+build() {
+  cd "${pkgbase}-$pkgver"
+  python setup.py build
+  python2 setup.py build
+}
+
 check() {
-  # Hack entry points by installing it
-
-  export LC_CTYPE=en_US.UTF-8
-
+  cd "${pkgbase}-$pkgver"
+  local python_version="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
   (
-    cd "$srcdir/coveragepy-$pkgver"
-    virtualenv "$srcdir/pyvenv" --system-site-packages
-    . "$srcdir/pyvenv/bin/activate"
-    export PYTHONPATH="$PYTHONPATH:/usr/lib/python3.8/site-packages"
-    python setup.py --quiet develop
+    virtualenv "test_dir" --system-site-packages
+    . "test_dir/bin/activate"
+    export PYTHONPATH="/usr/lib/python${python_version}/site-packages:${PYTHONPATH}"
+    python setup.py --quiet clean develop
     python igor.py zip_mods install_egg remove_extension
     python igor.py test_with_tracer py
     python setup.py --quiet build_ext --inplace
     python igor.py test_with_tracer c
-  ) || warning "Python 3 tests failed"
-
-  (
-    cd "$srcdir/coveragepy-$pkgver-py2"
-    virtualenv2 "$srcdir/pyvenv-py2" --system-site-packages
-    . "$srcdir/pyvenv-py2/bin/activate"
-    export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/site-packages"
-    python setup.py --quiet develop
-    python igor.py zip_mods install_egg remove_extension
-    python igor.py test_with_tracer py
-    python setup.py --quiet build_ext --inplace
-    python igor.py test_with_tracer c
-  ) || warning "Python 2 tests failed"
+  ) || echo "Known failing tests."
 }
 
 package_python-coverage() {
-  depends=('python')
+  depends=('python-setuptools')
+  optdepends=('python-toml: for pyproject.toml support')
+  cd "${pkgbase}-$pkgver"
 
-  cd coveragepy-$pkgver
-  python3 setup.py install --root="$pkgdir" --optimize=1
+  python setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
 }
 
 package_python2-coverage() {
-  depends=('python2')
+  depends=('python2-setuptools')
+  optdepends=('python2-toml: for pyproject.toml support')
+  cd "${pkgbase}-$pkgver"
 
-  cd coveragepy-$pkgver
-  python2 setup.py install --root="$pkgdir" --optimize=1
-
-  mv "$pkgdir/usr/bin/coverage" "$pkgdir/usr/bin/coverage2"
+  python2 setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
+  # circumvent file conflicts with python-coverage
+  mv -v "$pkgdir/usr/bin/coverage"{,2}
 }


More information about the arch-commits mailing list