Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cheroot/files/, dev-python/cheroot/
Date: Fri, 07 Jan 2022 20:18:38
Message-Id: 1641586612.72d451be36db5dadc6701312ca8ca6d7fc7e6072.arthurzam@gentoo
1 commit: 72d451be36db5dadc6701312ca8ca6d7fc7e6072
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 7 20:16:52 2022 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 7 20:16:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72d451be
7
8 dev-python/cheroot: add 8.6.0
9
10 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
11
12 dev-python/cheroot/Manifest | 1 +
13 dev-python/cheroot/cheroot-8.6.0.ebuild | 76 ++++++++++++++++++++++
14 .../files/cheroot-8.6.0-remove-pypytools-dep.patch | 74 +++++++++++++++++++++
15 3 files changed, 151 insertions(+)
16
17 diff --git a/dev-python/cheroot/Manifest b/dev-python/cheroot/Manifest
18 index 438df70f0b68..362aa364dfd0 100644
19 --- a/dev-python/cheroot/Manifest
20 +++ b/dev-python/cheroot/Manifest
21 @@ -1 +1,2 @@
22 DIST cheroot-8.5.2.tar.gz 113183 BLAKE2B a3b60a9df3f34913cfb8c99fbdc8580ea436710c7979e296c18a6981f54bb959d6a300f4cf9d4e608fe2987f58d5fc6d2b8f57bca800e461d31c77ac61fd6b01 SHA512 245c4157f5e11741d94375099878ef5b31945412a2b02961502e762b9770fd968f4f977fe2d74744aa6596c668079d7f07b6f129fa11438783a95d3a5ee088fa
23 +DIST cheroot-8.6.0.tar.gz 134779 BLAKE2B 97d1a9bf0a8d72d3204972934aa3ac4c97246b413edebd9f38caa802a5343acc426f137addfdc0faec58f6af2d62bc22023e93b14e1b0b07f6be9ffb12e78306 SHA512 26e48c935fe32d4ce3cf6ae20b5b272416ca53bd8496527c2958ec2ebe87529c831f283ae900e13271b610e39531b682df0376935ecc3bcfcca11c299cd2a893
24
25 diff --git a/dev-python/cheroot/cheroot-8.6.0.ebuild b/dev-python/cheroot/cheroot-8.6.0.ebuild
26 new file mode 100644
27 index 000000000000..7cf72b10dda7
28 --- /dev/null
29 +++ b/dev-python/cheroot/cheroot-8.6.0.ebuild
30 @@ -0,0 +1,76 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +inherit distutils-r1
38 +
39 +DESCRIPTION="High-performance, pure-Python HTTP server used by CherryPy"
40 +HOMEPAGE="https://cherrypy.org/
41 + https://pypi.org/project/cheroot/
42 + https://github.com/cherrypy/cheroot/"
43 +SRC_URI="mirror://pypi/C/${PN/c/C}/${P}.tar.gz"
44 +
45 +LICENSE="BSD"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~x86"
48 +
49 +RDEPEND="
50 + >=dev-python/six-1.11.0[${PYTHON_USEDEP}]
51 + >=dev-python/more-itertools-2.6[${PYTHON_USEDEP}]
52 + dev-python/jaraco-functools[${PYTHON_USEDEP}]
53 +"
54 +BDEPEND="
55 + test? (
56 + ${RDEPEND}
57 + dev-python/jaraco-context[${PYTHON_USEDEP}]
58 + dev-python/jaraco-text[${PYTHON_USEDEP}]
59 + dev-python/portend[${PYTHON_USEDEP}]
60 + dev-python/pytest-forked[${PYTHON_USEDEP}]
61 + >=dev-python/pytest-mock-1.11.0[${PYTHON_USEDEP}]
62 + dev-python/requests-toolbelt[${PYTHON_USEDEP}]
63 + dev-python/requests-unixsocket[${PYTHON_USEDEP}]
64 + dev-python/urllib3[${PYTHON_USEDEP}]
65 + !ia64? (
66 + dev-python/pyopenssl[${PYTHON_USEDEP}]
67 + dev-python/trustme[${PYTHON_USEDEP}]
68 + )
69 + )
70 +"
71 +
72 +PATCHES=(
73 + # Bad dep (upstream gone, only PyPi package, has py2 code, etc)
74 + "${FILESDIR}/${PN}-8.6.0-remove-pypytools-dep.patch"
75 +)
76 +
77 +distutils_enable_tests pytest
78 +
79 +python_prepare_all() {
80 + sed -e "s/use_scm_version=True/version='${PV}'/" -i setup.py || die
81 + sed -e '/setuptools_scm/d' -i setup.cfg || die
82 + sed -e '/--cov/d' \
83 + -e '/--testmon/d' \
84 + -e '/--numproc/d' \
85 + -i pytest.ini || die
86 +
87 + # broken
88 + sed -e '/False.*localhost/d' \
89 + -i cheroot/test/test_ssl.py || die
90 +
91 + distutils-r1_python_prepare_all
92 +}
93 +
94 +python_test() {
95 + local EPYTEST_IGNORE=()
96 + if ! has_version "dev-python/pyopenssl[${PYTHON_USEDEP}]" ||
97 + ! has_version "dev-python/trustme[${PYTHON_USEDEP}]"
98 + then
99 + EPYTEST_IGNORE+=(
100 + lib/cheroot/test/test_ssl.py
101 + )
102 + fi
103 +
104 + cd "${BUILD_DIR}" || die
105 + epytest
106 +}
107
108 diff --git a/dev-python/cheroot/files/cheroot-8.6.0-remove-pypytools-dep.patch b/dev-python/cheroot/files/cheroot-8.6.0-remove-pypytools-dep.patch
109 new file mode 100644
110 index 000000000000..f1f4fac26557
111 --- /dev/null
112 +++ b/dev-python/cheroot/files/cheroot-8.6.0-remove-pypytools-dep.patch
113 @@ -0,0 +1,74 @@
114 +diff --git a/cheroot/test/test_server.py b/cheroot/test/test_server.py
115 +index 8305c78c..39e4e066 100644
116 +--- a/cheroot/test/test_server.py
117 ++++ b/cheroot/test/test_server.py
118 +@@ -16,7 +16,6 @@ import requests
119 + import requests_unixsocket
120 + import six
121 +
122 +-from pypytools.gc.custom import DefaultGc
123 + from six.moves import queue, urllib
124 +
125 + from .._compat import bton, ntob
126 +@@ -330,8 +329,7 @@ def test_peercreds_unix_sock_with_lookup(peercreds_enabled_server):
127 + ),
128 + indirect=('resource_limit',),
129 + )
130 +-@×××××××××××.usefixtures('many_open_sockets')
131 +-def test_high_number_of_file_descriptors(native_server_client, resource_limit):
132 ++def _test_high_number_of_file_descriptors(native_server_client, resource_limit):
133 + """Test the server does not crash with a high file-descriptor value.
134 +
135 + This test shouldn't cause a server crash when trying to access
136 +@@ -363,18 +361,6 @@ def test_high_number_of_file_descriptors(native_server_client, resource_limit):
137 + assert any(fn >= resource_limit for fn in native_process_conn.filenos)
138 +
139 +
140 +-if not IS_WINDOWS:
141 +- test_high_number_of_file_descriptors = pytest.mark.forked(
142 +- test_high_number_of_file_descriptors,
143 +- )
144 +-
145 +-
146 +-@××××××.fixture
147 +-def _garbage_bin():
148 +- """Disable garbage collection when this fixture is in use."""
149 +- with DefaultGc().nogc():
150 +- yield
151 +-
152 +
153 + @pytest.fixture
154 + def resource_limit(request):
155 +@@ -400,32 +386,3 @@ def resource_limit(request):
156 + finally:
157 + # Reset the resource limit back to the original soft limit
158 + resource.setrlimit(resource.RLIMIT_NOFILE, (soft_limit, hard_limit))
159 +-
160 +-
161 +-@××××××.fixture
162 +-def many_open_sockets(request, resource_limit):
163 +- """Allocate a lot of file descriptors by opening dummy sockets."""
164 +- # NOTE: `@pytest.mark.usefixtures` doesn't work on fixtures which
165 +- # NOTE: forces us to invoke this one dynamically to avoid having an
166 +- # NOTE: unused argument.
167 +- request.getfixturevalue('_garbage_bin')
168 +-
169 +- # Hoard a lot of file descriptors by opening and storing a lot of sockets
170 +- test_sockets = []
171 +- # Open a lot of file descriptors, so the next one the server
172 +- # opens is a high number
173 +- try:
174 +- for _ in range(resource_limit):
175 +- sock = socket.socket()
176 +- test_sockets.append(sock)
177 +- # If we reach a high enough number, we don't need to open more
178 +- if sock.fileno() >= resource_limit:
179 +- break
180 +- # Check we opened enough descriptors to reach a high number
181 +- the_highest_fileno = test_sockets[-1].fileno()
182 +- assert the_highest_fileno >= resource_limit
183 +- yield the_highest_fileno
184 +- finally:
185 +- # Close our open resources
186 +- for test_socket in test_sockets:
187 +- test_socket.close()