Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-debian/, dev-python/python-debian/files/
Date: Sun, 01 Dec 2019 04:26:57
Message-Id: 1575174412.34383b63cdb73f700f0e8b672d7a0e83b01dc2f0.floppym@gentoo
1 commit: 34383b63cdb73f700f0e8b672d7a0e83b01dc2f0
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 1 04:25:40 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 1 04:26:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34383b63
7
8 dev-python/python-debian: bump to 0.1.36
9
10 Package-Manager: Portage-2.3.79_p3, Repoman-2.3.18_p2
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 dev-python/python-debian/Manifest | 1 +
14 .../files/0.1.36-test-no-apt-pkg.patch | 117 +++++++++++++++++++++
15 dev-python/python-debian/metadata.xml | 16 +--
16 .../python-debian/python-debian-0.1.36.ebuild | 40 +++++++
17 4 files changed, 166 insertions(+), 8 deletions(-)
18
19 diff --git a/dev-python/python-debian/Manifest b/dev-python/python-debian/Manifest
20 index 917c0ed1a41..916c6ad918f 100644
21 --- a/dev-python/python-debian/Manifest
22 +++ b/dev-python/python-debian/Manifest
23 @@ -1,3 +1,4 @@
24 DIST python-debian_0.1.28.tar.xz 292404 BLAKE2B 78634043fc0dabd378bae171a485931b080dc0d31cc7e2ea448c000a1c4250e322f900cf0a0a4c3a8505af6f10da692d0fad948bc253ede7a38e4fe98831924b SHA512 ffbc924fe2dfd5790d49aacf80109bbaa18126bb8d6c9b8ffa25e9ed8b1cdeb28024a8dc202587682088e2e558da1642385faa4afda925cbb2edf6f304592a0d
25 DIST python-debian_0.1.31.tar.xz 295720 BLAKE2B 3b3a68ab5604571355a15afac181e488c278ca78ab4c8a6cba4c392a0a89fd778bfd37e69a369d50fbc72f5080cf37fdbd31771f5d973c386795c436112ea347 SHA512 d2bf071b088e53ac132f91e5983c092bddb9736b3fd1394dfd2654fb8b6af7f89982af8debba8c4af21086d4f8a3ef86393fdef25ef18bcf71dcb00a60a8ae5b
26 DIST python-debian_0.1.32.tar.xz 296028 BLAKE2B 15e2678a1ec2f4d96baec8b9e3ce7b84d8ad37f520fe9f174d6fe9cac8adbcbb73f628d9c3cdf39eca2639855e797b8f8cef4c9517063d61aa1e3b3ce7f1df2c SHA512 2b55d9a3100028699ec63dd4861a4f60d44e03662cc144784a37cdd980f3ff276e6cd2e535a50cdc6db28bf44affdd576259d73e14e16a2bbeeeda0de0bdd194
27 +DIST python-debian_0.1.36.tar.xz 308364 BLAKE2B 1cc7e2844db8143a3a4cc4f59c4bbb90bb90ab024b2524335d8ab69947ffe8c64b2b41a54a5d199cd287a3d6b6a0173c75be708af9aedfeb871e354ac1873528 SHA512 3f2ca6d86f6b6d383a1628021a77d19b562b0c409d204dba4de6968d2cdd2c8fb4aa882429fa1ce6af5361352f7a51b339c481dd47937cb103a08132379d77c5
28
29 diff --git a/dev-python/python-debian/files/0.1.36-test-no-apt-pkg.patch b/dev-python/python-debian/files/0.1.36-test-no-apt-pkg.patch
30 new file mode 100644
31 index 00000000000..64b040852b7
32 --- /dev/null
33 +++ b/dev-python/python-debian/files/0.1.36-test-no-apt-pkg.patch
34 @@ -0,0 +1,117 @@
35 +From 0b4e4e02e62ab6069e855fc44fec1cbfba3e2f2a Mon Sep 17 00:00:00 2001
36 +From: Mike Gilbert <floppym@g.o>
37 +Date: Sat, 30 Nov 2019 23:18:05 -0500
38 +Subject: [PATCH] Remove tests that rely on apt_pkg
39 +
40 +---
41 + lib/debian/tests/test_deb822.py | 53 ---------------------------------
42 + 1 file changed, 53 deletions(-)
43 +
44 +diff --git a/lib/debian/tests/test_deb822.py b/lib/debian/tests/test_deb822.py
45 +index 7101727..64a724c 100755
46 +--- a/lib/debian/tests/test_deb822.py
47 ++++ b/lib/debian/tests/test_deb822.py
48 +@@ -40,8 +40,6 @@ else:
49 + from StringIO import StringIO
50 + BytesIO = StringIO
51 +
52 +-import apt_pkg #type: ignore
53 +-
54 + from debian import deb822
55 + from debian.debian_support import Version
56 +
57 +@@ -465,11 +463,6 @@ class TestDeb822(unittest.TestCase):
58 + for d in deb822.Deb822.iter_paragraphs(text, use_apt_pkg=False):
59 + self.assertWellParsed(d, PARSED_PACKAGE)
60 +
61 +- with self.assertWarns(UserWarning):
62 +- # The StringIO is not a real file so this will raise a warning
63 +- for d in deb822.Deb822.iter_paragraphs(text, use_apt_pkg=True):
64 +- self.assertWellParsed(d, PARSED_PACKAGE)
65 +-
66 + def test_iter_paragraphs_file(self):
67 + text = StringIO()
68 + text.write(UNPARSED_PACKAGE)
69 +@@ -487,10 +480,6 @@ class TestDeb822(unittest.TestCase):
70 + for d in deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=False):
71 + self.assertWellParsed(d, PARSED_PACKAGE)
72 +
73 +- fh.seek(0)
74 +- for d in deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=True):
75 +- self.assertWellParsed(d, PARSED_PACKAGE)
76 +-
77 +
78 + def test_iter_paragraphs_with_gpg(self):
79 + for string in GPG_SIGNED:
80 +@@ -556,12 +545,7 @@ class TestDeb822(unittest.TestCase):
81 + test_count(deb822.Deb822.iter_paragraphs, 2)
82 + test_count(deb822.Deb822.iter_paragraphs, 2, use_apt_pkg=False)
83 +
84 +- # apt_pkg used, should not split
85 +- test_count(deb822.Deb822.iter_paragraphs, 1, use_apt_pkg=True)
86 +-
87 + # Specialised iter_paragraphs force use of apt_pkg and don't split
88 +- test_count(deb822.Packages.iter_paragraphs, 1, use_apt_pkg=True)
89 +- test_count(deb822.Sources.iter_paragraphs, 1, use_apt_pkg=True)
90 + test_count(deb822.Packages.iter_paragraphs, 1, use_apt_pkg=False)
91 + test_count(deb822.Sources.iter_paragraphs, 1, use_apt_pkg=False)
92 +
93 +@@ -607,27 +591,11 @@ class TestDeb822(unittest.TestCase):
94 + s.write(b"\n")
95 + self.assertEqual(s.getvalue(), packages_content)
96 +
97 +- def test_iter_paragraphs_apt_shared_storage_packages(self):
98 +- self._test_iter_paragraphs(find_test_file("test_Packages"),
99 +- deb822.Packages,
100 +- use_apt_pkg=True, shared_storage=True)
101 +- def test_iter_paragraphs_apt_no_shared_storage_packages(self):
102 +- self._test_iter_paragraphs(find_test_file("test_Packages"),
103 +- deb822.Packages,
104 +- use_apt_pkg=True, shared_storage=False)
105 + def test_iter_paragraphs_no_apt_no_shared_storage_packages(self):
106 + self._test_iter_paragraphs(find_test_file("test_Packages"),
107 + deb822.Packages,
108 + use_apt_pkg=False, shared_storage=False)
109 +
110 +- def test_iter_paragraphs_apt_shared_storage_sources(self):
111 +- self._test_iter_paragraphs(find_test_file("test_Sources"),
112 +- deb822.Sources,
113 +- use_apt_pkg=True, shared_storage=True)
114 +- def test_iter_paragraphs_apt_no_shared_storage_sources(self):
115 +- self._test_iter_paragraphs(find_test_file("test_Sources"),
116 +- deb822.Sources,
117 +- use_apt_pkg=True, shared_storage=False)
118 + def test_iter_paragraphs_no_apt_no_shared_storage_sources(self):
119 + self._test_iter_paragraphs(find_test_file("test_Sources"),
120 + deb822.Sources,
121 +@@ -973,27 +941,6 @@ Description: python modules to work with Debian-related data formats
122 + self.assertWellParsed(paragraphs[i],
123 + PARSED_PARAGRAPHS_WITH_COMMENTS[i])
124 +
125 +- def test_iter_paragraphs_comments_use_apt_pkg(self):
126 +- """ apt_pkg does not support comments within multiline fields
127 +-
128 +- This test checks that a file with comments inside multiline fields
129 +- generates an error from the apt_pkg parser.
130 +-
131 +- See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750247#35
132 +- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807351
133 +- """
134 +- try:
135 +- fd, filename = tempfile.mkstemp()
136 +- fp = os.fdopen(fd, 'wb')
137 +- fp.write(UNPARSED_PARAGRAPHS_WITH_COMMENTS.encode('utf-8'))
138 +- fp.close()
139 +-
140 +- with open_utf8(filename) as fh:
141 +- with self.assertRaises(apt_pkg.Error):
142 +- list(deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=True))
143 +- finally:
144 +- os.remove(filename)
145 +-
146 + def test_iter_paragraphs_comments_native(self):
147 + paragraphs = list(deb822.Deb822.iter_paragraphs(
148 + UNPARSED_PARAGRAPHS_WITH_COMMENTS.splitlines(), use_apt_pkg=False))
149 +--
150 +2.24.0
151 +
152
153 diff --git a/dev-python/python-debian/metadata.xml b/dev-python/python-debian/metadata.xml
154 index b45b94729bb..37d58853f5c 100644
155 --- a/dev-python/python-debian/metadata.xml
156 +++ b/dev-python/python-debian/metadata.xml
157 @@ -1,12 +1,12 @@
158 <?xml version="1.0" encoding="UTF-8"?>
159 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
160 <pkgmetadata>
161 - <maintainer type="person">
162 - <email>floppym@g.o</email>
163 - <name>Mike Gilbert</name>
164 - </maintainer>
165 -<maintainer type="project">
166 - <email>python@g.o</email>
167 - <name>Python</name>
168 - </maintainer>
169 + <maintainer type="person">
170 + <email>floppym@g.o</email>
171 + <name>Mike Gilbert</name>
172 + </maintainer>
173 + <maintainer type="project">
174 + <email>python@g.o</email>
175 + <name>Python</name>
176 + </maintainer>
177 </pkgmetadata>
178
179 diff --git a/dev-python/python-debian/python-debian-0.1.36.ebuild b/dev-python/python-debian/python-debian-0.1.36.ebuild
180 new file mode 100644
181 index 00000000000..49012658cf5
182 --- /dev/null
183 +++ b/dev-python/python-debian/python-debian-0.1.36.ebuild
184 @@ -0,0 +1,40 @@
185 +# Copyright 1999-2019 Gentoo Authors
186 +# Distributed under the terms of the GNU General Public License v2
187 +
188 +EAPI=7
189 +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy )
190 +
191 +inherit distutils-r1
192 +
193 +DESCRIPTION="Python modules to work with Debian-related data formats"
194 +HOMEPAGE="https://packages.debian.org/sid/python-debian"
195 +SRC_URI="mirror://debian/pool/main/${P:0:1}/${PN}/${PN}_${PV}.tar.xz"
196 +
197 +LICENSE="GPL-2 GPL-3"
198 +SLOT="0"
199 +KEYWORDS="~amd64 ~x86"
200 +IUSE="test"
201 +RESTRICT="!test? ( test )"
202 +
203 +RDEPEND="
204 + dev-python/chardet[${PYTHON_USEDEP}]
205 + dev-python/six[${PYTHON_USEDEP}]
206 +"
207 +
208 +BDEPEND="${RDEPEND}
209 + dev-python/setuptools[${PYTHON_USEDEP}]
210 + test? (
211 + app-arch/dpkg
212 + $(python_gen_cond_dep 'dev-python/unittest2[${PYTHON_USEDEP}]' -2)
213 + )
214 +"
215 +
216 +PATCHES=( "${FILESDIR}/0.1.36-test-no-apt-pkg.patch" )
217 +
218 +python_compile_all() {
219 + ${EPYTHON} lib/debian/doc-debtags > README.debtags || die
220 +}
221 +
222 +python_test() {
223 + ${EPYTHON} -m unittest discover --verbose lib || die "Testing failed with ${EPYTHON}"
224 +}