1 |
commit: 977bfe4f10635f3be74c2d4f9cb58c4ce934f87e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 16 13:26:24 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 16 13:29:20 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=977bfe4f |
7 |
|
8 |
dev-python/chardet: Enable py3.8, fix tests |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/chardet/chardet-3.0.4.ebuild | 22 ++++++++------------- |
13 |
.../chardet/files/chardet-3.0.4-pytest-4.patch | 23 ++++++++++++++++++++++ |
14 |
2 files changed, 31 insertions(+), 14 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/chardet/chardet-3.0.4.ebuild b/dev-python/chardet/chardet-3.0.4.ebuild |
17 |
index c929783b3e2..6dce19acd09 100644 |
18 |
--- a/dev-python/chardet/chardet-3.0.4.ebuild |
19 |
+++ b/dev-python/chardet/chardet-3.0.4.ebuild |
20 |
@@ -3,7 +3,7 @@ |
21 |
|
22 |
EAPI=6 |
23 |
|
24 |
-PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy pypy3 ) |
25 |
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy pypy3 ) |
26 |
|
27 |
inherit distutils-r1 |
28 |
|
29 |
@@ -17,20 +17,14 @@ SRC_URI="https://github.com/chardet/chardet/archive/${PV}.tar.gz -> ${P}.tar.gz" |
30 |
LICENSE="LGPL-2.1" |
31 |
SLOT="0" |
32 |
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris" |
33 |
-IUSE="test" |
34 |
-RESTRICT="!test? ( test )" |
35 |
- |
36 |
-RDEPEND=" |
37 |
- dev-python/setuptools[${PYTHON_USEDEP}] |
38 |
-" |
39 |
|
40 |
+RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" |
41 |
DEPEND="${RDEPEND} |
42 |
- test? ( |
43 |
- dev-python/pytest[${PYTHON_USEDEP}] |
44 |
- dev-python/hypothesis[${PYTHON_USEDEP}] |
45 |
- ) |
46 |
+ test? ( dev-python/hypothesis[${PYTHON_USEDEP}] ) |
47 |
" |
48 |
|
49 |
-python_test() { |
50 |
- py.test -v || die "Tests fail with ${EPYTHON}" |
51 |
-} |
52 |
+PATCHES=( |
53 |
+ "${FILESDIR}"/${P}-pytest-4.patch |
54 |
+) |
55 |
+ |
56 |
+distutils_enable_tests pytest |
57 |
|
58 |
diff --git a/dev-python/chardet/files/chardet-3.0.4-pytest-4.patch b/dev-python/chardet/files/chardet-3.0.4-pytest-4.patch |
59 |
new file mode 100644 |
60 |
index 00000000000..eef88e9e996 |
61 |
--- /dev/null |
62 |
+++ b/dev-python/chardet/files/chardet-3.0.4-pytest-4.patch |
63 |
@@ -0,0 +1,23 @@ |
64 |
+From 0561ddcedcd12ea1f98b7ddedb93686ed8a5ffa4 Mon Sep 17 00:00:00 2001 |
65 |
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@×××××××.cz> |
66 |
+Date: Tue, 12 Mar 2019 18:44:36 +0100 |
67 |
+Subject: [PATCH] Support pytest 4, don't apply marks directly to parameters |
68 |
+ |
69 |
+Fixes https://github.com/chardet/chardet/issues/173 |
70 |
+--- |
71 |
+ test.py | 2 +- |
72 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
73 |
+ |
74 |
+diff --git a/test.py b/test.py |
75 |
+index 9833307..ad2b753 100644 |
76 |
+--- a/test.py |
77 |
++++ b/test.py |
78 |
+@@ -59,7 +59,7 @@ def gen_test_params(): |
79 |
+ full_path = join(path, file_name) |
80 |
+ test_case = full_path, encoding |
81 |
+ if full_path in EXPECTED_FAILURES: |
82 |
+- test_case = pytest.mark.xfail(test_case) |
83 |
++ test_case = pytest.param(*test_case, marks=pytest.mark.xfail) |
84 |
+ yield test_case |
85 |
+ |
86 |
+ |