aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Maxwell <keith.maxwell@gmail.com>2020-04-11 20:33:38 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-04-11 20:09:11 +0000
commit5476202af29c1cb76028aecf5d7ec9cd6afee687 (patch)
treebd37ae5c09ae7d8c90f37ba3e4800696c44c8d4c
parente00ba8b6f493c6e7d1434ec2a0682a5cb302e3bb (diff)
downloadaports-5476202af29c1cb76028aecf5d7ec9cd6afee687.tar.gz
aports-5476202af29c1cb76028aecf5d7ec9cd6afee687.tar.bz2
aports-5476202af29c1cb76028aecf5d7ec9cd6afee687.tar.xz
main/py3-chardet: add check() & missing dependency
Adds a patch so that the tests work with pytest>=4.0. Upstream have merged the patch but have not released a new version. Before this change: $ sudo apk add py3-chardet ✂ $ chardetect --version Traceback (most recent call last): File "/usr/bin/chardetect", line 6, in <module> from pkg_resources import load_entry_point ModuleNotFoundError: No module named 'pkg_resources' After this change: $ sudo apk add py3-chardet ✂ $ chardetect --version chardetect 3.0.4 The above commands were run inside docker-abuild with `dabuild sh`. The change is required because `/usr/bin/chardetect` includes the line: from pkg_resources import load_entry_point That means that py3-setuptools is required at runtime: $ python3 -c 'import pkg_resources; print(pkg_resources.__file__)' /usr/lib/python3.8/site-packages/pkg_resources/__init__.py $ apk info -q -W /usr/lib/python3.8/site-packages/pkg_resources/__init__.py py3-setuptools
-rw-r--r--main/py3-chardet/440828f8faafdb58700c64a9ea8f6a30b154c08b.patch26
-rw-r--r--main/py3-chardet/APKBUILD14
2 files changed, 33 insertions, 7 deletions
diff --git a/main/py3-chardet/440828f8faafdb58700c64a9ea8f6a30b154c08b.patch b/main/py3-chardet/440828f8faafdb58700c64a9ea8f6a30b154c08b.patch
new file mode 100644
index 0000000000..c50feb1638
--- /dev/null
+++ b/main/py3-chardet/440828f8faafdb58700c64a9ea8f6a30b154c08b.patch
@@ -0,0 +1,26 @@
+https://github.com/chardet/chardet/commit/440828f8faafdb58700c64a9ea8f6a30b154c08b.patch
+
+From 440828f8faafdb58700c64a9ea8f6a30b154c08b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Mon, 11 Nov 2019 21:02:51 +0100
+Subject: [PATCH] Support pytest 4, don't apply marks directly to parameters
+ (#174)
+
+Fixes https://github.com/chardet/chardet/issues/173
+---
+ test.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test.py b/test.py
+index 9833307..ad2b753 100644
+--- a/test.py
++++ b/test.py
+@@ -59,7 +59,7 @@ def gen_test_params():
+ full_path = join(path, file_name)
+ test_case = full_path, encoding
+ if full_path in EXPECTED_FAILURES:
+- test_case = pytest.mark.xfail(test_case)
++ test_case = pytest.param(*test_case, marks=pytest.mark.xfail)
+ yield test_case
+
+
diff --git a/main/py3-chardet/APKBUILD b/main/py3-chardet/APKBUILD
index 134e9ac730..56c191c3e0 100644
--- a/main/py3-chardet/APKBUILD
+++ b/main/py3-chardet/APKBUILD
@@ -3,16 +3,15 @@
_pkgname=chardet
pkgname=py3-$_pkgname
pkgver=3.0.4
-pkgrel=3
+pkgrel=4
pkgdesc="The Universal Character Encoding Detector"
-options="!check" # Requires 'hypothesis'
url="https://github.com/chardet/chardet/"
arch="noarch"
license="LGPL-2.1-or-later"
-depends="python3"
-makedepends="py3-setuptools"
+depends="python3 py3-setuptools"
checkdepends="py3-pytest"
-source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
+source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
+ 440828f8faafdb58700c64a9ea8f6a30b154c08b.patch"
builddir="$srcdir/$_pkgname-$pkgver"
replaces="py-chardet" # Backwards compatibility
@@ -23,11 +22,12 @@ build() {
}
check() {
- python3 setup.py test
+ python3 -m pytest
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}
-sha512sums="61a03b23447a2bfe52ceed4dd1b9afdb5784da1933a623776883ee9f297e341f633e27f0ce0230bd5fdc5fdb5382105ab42736a74a417ddeb9f83af57455dba5 chardet-3.0.4.tar.gz"
+sha512sums="61a03b23447a2bfe52ceed4dd1b9afdb5784da1933a623776883ee9f297e341f633e27f0ce0230bd5fdc5fdb5382105ab42736a74a417ddeb9f83af57455dba5 chardet-3.0.4.tar.gz
+6b4f87cca02579e2499b590e3bc85ef5afc5ced7a94af65af9669ed06a493deb01dd9a211bbc01d75fef2e7cb7b4157d3480afb32b113a24dd21e88aed8638ad 440828f8faafdb58700c64a9ea8f6a30b154c08b.patch"