Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/jaraco-functools/, dev-python/jaraco-functools/files/
Date: Tue, 02 Jul 2019 14:03:55
Message-Id: 1562076178.c80478b9ff46e877d10b881868714679d7ca1e1f.sbraz@gentoo
1 commit: c80478b9ff46e877d10b881868714679d7ca1e1f
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 2 13:34:34 2019 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 2 14:02:58 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c80478b9
7
8 dev-python/jaraco-functools: bump to 2.0, switches to pkgutil
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.16
11 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
12
13 dev-python/jaraco-functools/Manifest | 1 +
14 .../jaraco-functools-2.0-fix-py37-tests.patch | 41 ++++++++++++++
15 .../jaraco-functools/jaraco-functools-2.0.ebuild | 64 ++++++++++++++++++++++
16 3 files changed, 106 insertions(+)
17
18 diff --git a/dev-python/jaraco-functools/Manifest b/dev-python/jaraco-functools/Manifest
19 index d63ec84b252..d6c4b82c244 100644
20 --- a/dev-python/jaraco-functools/Manifest
21 +++ b/dev-python/jaraco-functools/Manifest
22 @@ -1,2 +1,3 @@
23 DIST jaraco.functools-1.19.tar.gz 10588 BLAKE2B c71eb4e0c611f6a0bd82e04cacb7933961ba5e50091439c274bd8ceeda68b69789423994fe43f44af6cdd643b7a04418bc32ce2f937d118520298a019c5c6638 SHA512 7fbf1956ff8a132021e1f7fae5e98f40199a5d0e705b08b44ad5b2588fdd7d1088db9d7457b985c1852b50285a8f03cc9795fff0c4f53f9155f7c8ec371ff307
24 DIST jaraco.functools-1.20.tar.gz 11063 BLAKE2B c202c3cda86c0f32fb3299a083ebb8d584eec444d9d8f0eff536f5e663634dab03c5831aef18d683dddde7eafff311b66a724d9004ad46f5ef92e90df16a9c7d SHA512 ba17b567dfcadb0d8ff1cc7a6ed07f2a23abfd42e73f3d815a6fa19d9be97d6af0c90bff7fb5e7ef67012ea5d931e9babc963da8a7105ba6a92d5c43c7126e04
25 +DIST jaraco.functools-2.0.tar.gz 14340 BLAKE2B 560490b1150c2385f9c4d468fe7ab4fa84475ad43e1ebed784343a71742976ed0c18df3f6240b1d5b69106a6835c0248838331a654f9d3fdc863622c3dda33be SHA512 dce30c08f0e9f3c7b682c78fc3a46a26d9972706f4c8449a12ba11aa5ed130c6d9ca405213fd93b6b4110ef9cea549e5fa925c96bfaf18681cd6957d8ba0889f
26
27 diff --git a/dev-python/jaraco-functools/files/jaraco-functools-2.0-fix-py37-tests.patch b/dev-python/jaraco-functools/files/jaraco-functools-2.0-fix-py37-tests.patch
28 new file mode 100644
29 index 00000000000..dc296c4eb47
30 --- /dev/null
31 +++ b/dev-python/jaraco-functools/files/jaraco-functools-2.0-fix-py37-tests.patch
32 @@ -0,0 +1,41 @@
33 +From cc972095e5aa2ae80d1d69d7ca84ee94178e869a Mon Sep 17 00:00:00 2001
34 +From: "Jason R. Coombs" <jaraco@××××××.com>
35 +Date: Sat, 20 Apr 2019 07:08:41 -0400
36 +Subject: [PATCH] Rewrite docstring on Python 3.7.3 to allow the test to pass.
37 + Fixes #12.
38 +
39 +---
40 + conftest.py | 24 ++++++++++++++++++++++++
41 + 1 file changed, 24 insertions(+)
42 + create mode 100644 conftest.py
43 +
44 +diff --git a/conftest.py b/conftest.py
45 +new file mode 100644
46 +index 0000000..b6fad41
47 +--- /dev/null
48 ++++ b/conftest.py
49 +@@ -0,0 +1,24 @@
50 ++import sys
51 ++import re
52 ++
53 ++import jaraco.functools
54 ++
55 ++
56 ++def pytest_configure():
57 ++ patch_for_issue_12()
58 ++
59 ++
60 ++def patch_for_issue_12():
61 ++ """
62 ++ Issue #12 revealed that Python 3.7.3 had a subtle
63 ++ change in the C implementation of functools that
64 ++ broke the assumptions around the method_cache (or
65 ++ any caller using possibly empty keyword arguments).
66 ++ This patch adjusts the docstring for that test so it
67 ++ can pass on that Python version.
68 ++ """
69 ++ affected_ver = 3, 7, 3
70 ++ if sys.version_info[:3] != affected_ver:
71 ++ return
72 ++ mc = jaraco.functools.method_cache
73 ++ mc.__doc__ = re.sub(r'^(\s+)75', r'\g<1>76', mc.__doc__, flags=re.M)
74
75 diff --git a/dev-python/jaraco-functools/jaraco-functools-2.0.ebuild b/dev-python/jaraco-functools/jaraco-functools-2.0.ebuild
76 new file mode 100644
77 index 00000000000..c6edbff3e67
78 --- /dev/null
79 +++ b/dev-python/jaraco-functools/jaraco-functools-2.0.ebuild
80 @@ -0,0 +1,64 @@
81 +# Copyright 1999-2019 Gentoo Authors
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=7
85 +
86 +PYTHON_COMPAT=( pypy3 python{2_7,3_{5,6,7}} )
87 +
88 +inherit distutils-r1
89 +
90 +MY_PN="${PN/-/.}"
91 +DESCRIPTION="Additional functions used by other projects by developer jaraco"
92 +HOMEPAGE="https://github.com/jaraco/jaraco.functools"
93 +SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
94 +
95 +LICENSE="MIT"
96 +SLOT="0"
97 +KEYWORDS="~amd64 ~arm64 ~x86"
98 +IUSE="doc test"
99 +
100 +RDEPEND="
101 + >=dev-python/namespace-jaraco-2[${PYTHON_USEDEP}]
102 + dev-python/more-itertools[${PYTHON_USEDEP}]
103 + $(python_gen_cond_dep 'dev-python/backports-functools-lru-cache[${PYTHON_USEDEP}]' python2_7)
104 +"
105 +DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
106 + >=dev-python/setuptools_scm-1.15.0[${PYTHON_USEDEP}]
107 + doc? (
108 + >=dev-python/jaraco-packaging-3.2[${PYTHON_USEDEP}]
109 + >=dev-python/rst-linker-1.9[${PYTHON_USEDEP}]
110 + dev-python/sphinx[${PYTHON_USEDEP}]
111 + )
112 + test? (
113 + ${RDEPEND}
114 + >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
115 + dev-python/backports-unittest-mock[${PYTHON_USEDEP}]
116 + dev-python/jaraco-classes[${PYTHON_USEDEP}]
117 + dev-python/six[${PYTHON_USEDEP}]
118 + )
119 +"
120 +
121 +S="${WORKDIR}/${MY_PN}-${PV}"
122 +
123 +PATCHES=( "${FILESDIR}/${P}-fix-py37-tests.patch" )
124 +
125 +python_compile_all() {
126 + if use doc; then
127 + cd docs || die
128 + sphinx-build . _build/html || die
129 + HTML_DOCS=( docs/_build/html/. )
130 + fi
131 +}
132 +
133 +python_test() {
134 + # Override pytest options to skip flake8
135 + PYTHONPATH=. pytest -vv --override-ini="addopts=--doctest-modules" \
136 + || die "tests failed with ${EPYTHON}"
137 +}
138 +
139 +# https://wiki.gentoo.org/wiki/Project:Python/Namespace_packages#File_collisions_between_pkgutil-style_packages
140 +python_install() {
141 + rm "${BUILD_DIR}"/lib/jaraco/__init__.py || die
142 + # note: eclass may default to --skip-build in the future
143 + distutils-r1_python_install --skip-build
144 +}