[arch-commits] Commit in python-cssutils/trunk (PKGBUILD)
Eli Schwartz
eschwartz at archlinux.org
Thu Aug 20 01:35:35 UTC 2020
Date: Thursday, August 20, 2020 @ 01:35:34
Author: eschwartz
Revision: 685257
python-cssutils: revamp build, purge no-op fixups, run tests cleanly
Modified:
python-cssutils/trunk/PKGBUILD
----------+
PKGBUILD | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-08-20 00:24:12 UTC (rev 685256)
+++ PKGBUILD 2020-08-20 01:35:34 UTC (rev 685257)
@@ -13,28 +13,33 @@
license=('LGPL3')
depends=('python')
makedepends=('python-setuptools')
-# We need to include mock as a check dependency due to the following pbr bug:
-# https://bugs.launchpad.net/pbr/+bug/1493735
-source=("https://pypi.python.org/packages/5c/0b/c5f29d29c037e97043770b5e7c740b6252993e4b57f029b3cd03c78ddfec/cssutils-1.0.2.tar.gz")
+checkdepends=('python-pbr')
+source=("https://files.pythonhosted.org/packages/source/c/cssutils/cssutils-${pkgver}.tar.gz")
md5sums=('dc66d96c2d78f1687f59ac412fe9d318')
-build() {
- # Use #!/usr/bin/python3
- cd cssutils-${pkgver}/src
- find . -maxdepth 2 -mindepth 1 -type f -iname '*.py' -exec sed -i 's/env python/python3/' '{}' \;
+prepare() {
+ cd cssutils-${pkgver}
+
+ # don't pin old versions of testrunner
+ sed -i "/tests_require/{s/pbr < 1\.7\.0/pbr/;s/'mock',//}" setup.py
+ sed -i 's/import mock/from unittest import mock/' src/cssutils/tests/*.py
}
-package() {
- cd "cssutils-${pkgver}"
+build() {
+ cd cssutils-${pkgver}
- python3 setup.py install --root="${pkgdir}/" --optimize=1
-
- # Don't install tests (FS#27567)
- rm -rf "${pkgdir}/usr/lib/python3.3/site-packages/tests"
+ 2to3 --no-diffs -nw src
+ python setup.py build
}
check() {
cd "${srcdir}/cssutils-${pkgver}"
- 2to3 --no-diffs -nw src
+
python3 setup.py test
}
+
+package() {
+ cd "cssutils-${pkgver}"
+
+ python3 setup.py install --root="${pkgdir}/" --optimize=1
+}
More information about the arch-commits
mailing list