1 |
commit: f488163d4fc1834b8727556be3084702293ead72 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 9 16:36:48 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 9 16:36:59 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f488163d |
7 |
|
8 |
dev-python/pydantic: Switch to PEP517 build |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/pydantic/pydantic-1.9.0-r1.ebuild | 73 ++++++++++++++++++++++++++++ |
13 |
1 file changed, 73 insertions(+) |
14 |
|
15 |
diff --git a/dev-python/pydantic/pydantic-1.9.0-r1.ebuild b/dev-python/pydantic/pydantic-1.9.0-r1.ebuild |
16 |
new file mode 100644 |
17 |
index 000000000000..1e26b96ea70b |
18 |
--- /dev/null |
19 |
+++ b/dev-python/pydantic/pydantic-1.9.0-r1.ebuild |
20 |
@@ -0,0 +1,73 @@ |
21 |
+# Copyright 1999-2022 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=8 |
25 |
+ |
26 |
+DISTUTILS_USE_PEP517=setuptools |
27 |
+PYTHON_COMPAT=( pypy3 python3_{8..10} ) |
28 |
+ |
29 |
+inherit distutils-r1 |
30 |
+ |
31 |
+DESCRIPTION="Data parsing and validation using Python type hints" |
32 |
+HOMEPAGE="https://github.com/samuelcolvin/pydantic" |
33 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
34 |
+ |
35 |
+LICENSE="MIT" |
36 |
+SLOT="0" |
37 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
38 |
+ |
39 |
+RDEPEND=" |
40 |
+ dev-python/typing-extensions[${PYTHON_USEDEP}] |
41 |
+" |
42 |
+BDEPEND=" |
43 |
+ dev-python/cython[${PYTHON_USEDEP}] |
44 |
+ test? ( |
45 |
+ dev-python/hypothesis[${PYTHON_USEDEP}] |
46 |
+ dev-python/pytest-mock[${PYTHON_USEDEP}] |
47 |
+ dev-python/python-dotenv[${PYTHON_USEDEP}] |
48 |
+ dev-python/python-email-validator[${PYTHON_USEDEP}] |
49 |
+ ) |
50 |
+" |
51 |
+ |
52 |
+distutils_enable_tests pytest |
53 |
+ |
54 |
+src_prepare() { |
55 |
+ sed -i -e '/CFLAGS/d' setup.py || die |
56 |
+ distutils-r1_src_prepare |
57 |
+} |
58 |
+ |
59 |
+python_compile() { |
60 |
+ distutils-r1_python_compile |
61 |
+ # "setup.py clean" is broken |
62 |
+ # TODO: remove this if distutils-r1.eclass is updated to do rm |
63 |
+ rm -rf build || die |
64 |
+} |
65 |
+ |
66 |
+python_test() { |
67 |
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 |
68 |
+ local -x PYTEST_PLUGINS=pytest_mock |
69 |
+ |
70 |
+ local EPYTEST_DESELECT=( |
71 |
+ # flaky test, known upstream |
72 |
+ tests/test_hypothesis_plugin.py::test_can_construct_models_with_all_fields |
73 |
+ ) |
74 |
+ case ${EPYTHON} in |
75 |
+ python3.8) |
76 |
+ EPYTEST_DESELECT+=( |
77 |
+ # Those fail on python 3.8 as None changed typing semantic on >=3.9 |
78 |
+ "tests/test_types.py::test_none[value_type3]" |
79 |
+ tests/test_typing.py::test_is_none_type |
80 |
+ ) |
81 |
+ ;; |
82 |
+ pypy3) |
83 |
+ EPYTEST_DESELECT+=( |
84 |
+ tests/test_private_attributes.py::test_private_attribute |
85 |
+ tests/test_private_attributes.py::test_private_attribute_annotation |
86 |
+ tests/test_private_attributes.py::test_private_attribute_factory |
87 |
+ tests/test_private_attributes.py::test_private_attribute_multiple_inheritance |
88 |
+ tests/test_private_attributes.py::test_underscore_attrs_are_private |
89 |
+ ) |
90 |
+ ;; |
91 |
+ esac |
92 |
+ epytest |
93 |
+} |