1 |
commit: bc9ab1a2ab6419fa03e4217c9c768c2a716bc56a |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 22 12:57:54 2021 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 22 13:10:14 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc9ab1a2 |
7 |
|
8 |
dev-python/docopt: make tests compatible with >=pytest-6 |
9 |
|
10 |
While at it, remove bits which are now handled by the eclass. |
11 |
|
12 |
Invoking maintainer time-out. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/737924 |
15 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
16 |
|
17 |
dev-python/docopt/docopt-0.6.2-r4.ebuild | 22 ++++++++++++++++++ |
18 |
.../docopt-0.6.2-pytest_node_from_parent.patch | 26 ++++++++++++++++++++++ |
19 |
2 files changed, 48 insertions(+) |
20 |
|
21 |
diff --git a/dev-python/docopt/docopt-0.6.2-r4.ebuild b/dev-python/docopt/docopt-0.6.2-r4.ebuild |
22 |
new file mode 100644 |
23 |
index 00000000000..43fc62d58df |
24 |
--- /dev/null |
25 |
+++ b/dev-python/docopt/docopt-0.6.2-r4.ebuild |
26 |
@@ -0,0 +1,22 @@ |
27 |
+# Copyright 1999-2021 Gentoo Authors |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+ |
30 |
+EAPI=7 |
31 |
+ |
32 |
+PYTHON_COMPAT=( pypy3 python3_{8..10} ) |
33 |
+ |
34 |
+inherit distutils-r1 |
35 |
+ |
36 |
+DESCRIPTION="Pythonic argument parser, that will make you smile" |
37 |
+HOMEPAGE="https://pypi.org/project/docopt/ https://github.com/docopt/docopt" |
38 |
+SRC_URI="https://github.com/docopt/docopt/archive/${PV}.tar.gz -> ${P}.gh.tar.gz" |
39 |
+ |
40 |
+LICENSE="MIT" |
41 |
+SLOT="0" |
42 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" |
43 |
+ |
44 |
+PATCHES=( |
45 |
+ "${FILESDIR}"/${PN}-0.6.2-pytest_node_from_parent.patch |
46 |
+) |
47 |
+ |
48 |
+distutils_enable_tests pytest |
49 |
|
50 |
diff --git a/dev-python/docopt/files/docopt-0.6.2-pytest_node_from_parent.patch b/dev-python/docopt/files/docopt-0.6.2-pytest_node_from_parent.patch |
51 |
new file mode 100644 |
52 |
index 00000000000..bf6ef1f8034 |
53 |
--- /dev/null |
54 |
+++ b/dev-python/docopt/files/docopt-0.6.2-pytest_node_from_parent.patch |
55 |
@@ -0,0 +1,26 @@ |
56 |
+--- a/conftest.py |
57 |
++++ b/conftest.py |
58 |
+@@ -11,7 +11,10 @@ |
59 |
+ |
60 |
+ def pytest_collect_file(path, parent): |
61 |
+ if path.ext == ".docopt" and path.basename.startswith("test"): |
62 |
+- return DocoptTestFile(path, parent) |
63 |
++ if hasattr(DocoptTestFile, "from_parent"): |
64 |
++ return DocoptTestFile.from_parent(parent, fspath=path) |
65 |
++ else: |
66 |
++ return DocoptTestFile(path, parent) |
67 |
+ |
68 |
+ |
69 |
+ def parse_test(raw): |
70 |
+@@ -41,7 +44,10 @@ |
71 |
+ for name, doc, cases in parse_test(raw): |
72 |
+ name = self.fspath.purebasename |
73 |
+ for case in cases: |
74 |
+- yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case) |
75 |
++ if hasattr(DocoptTestItem, "from_parent"): |
76 |
++ yield DocoptTestItem.from_parent(self, name="%s(%d)" % (name, index), doc=doc, case=case) |
77 |
++ else: |
78 |
++ yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case) |
79 |
+ index += 1 |
80 |
+ |
81 |
+ |