Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-vcs/dandi-cli/files/, dev-vcs/dandi-cli/
Date: Tue, 05 Apr 2022 06:38:48
Message-Id: 1649140663.faa81d913f61a8aa019bb8eaba9c40838251e1a5.chymera@gentoo
1 commit: faa81d913f61a8aa019bb8eaba9c40838251e1a5
2 Author: Horea Christian <chr <AT> chymera <DOT> eu>
3 AuthorDate: Tue Apr 5 06:37:43 2022 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Tue Apr 5 06:37:43 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=faa81d91
7
8 dev-vcs/dandi-cli: new package
9
10 Some etelemetry issues remain
11
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Horea Christian <chr <AT> chymera.eu>
14
15 dev-vcs/dandi-cli/dandi-cli-0.35.0.ebuild | 83 +++++++++++++++++++++
16 dev-vcs/dandi-cli/dandi-cli-0.37.0.ebuild | 86 ++++++++++++++++++++++
17 dev-vcs/dandi-cli/dandi-cli-0.38.0.ebuild | 86 ++++++++++++++++++++++
18 .../files/dandi-cli-0.28.0-no-etelemetry.patch | 30 ++++++++
19 .../files/dandi-cli-0.34.1-pip-versioncheck.patch | 13 ++++
20 .../files/dandi-cli-0.35.0-test_nonetwork.patch | 21 ++++++
21 .../files/dandi-cli-0.37.0-pip-versioncheck.patch | 13 ++++
22 dev-vcs/dandi-cli/metadata.xml | 26 +++++++
23 8 files changed, 358 insertions(+)
24
25 diff --git a/dev-vcs/dandi-cli/dandi-cli-0.35.0.ebuild b/dev-vcs/dandi-cli/dandi-cli-0.35.0.ebuild
26 new file mode 100644
27 index 000000000..e59f3ca7f
28 --- /dev/null
29 +++ b/dev-vcs/dandi-cli/dandi-cli-0.35.0.ebuild
30 @@ -0,0 +1,83 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +DISTUTILS_USE_PEP517=setuptools
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +
39 +inherit distutils-r1
40 +
41 +DESCRIPTION="DANDI command line client to facilitate common operations"
42 +HOMEPAGE="https://github.com/dandi/dandi-cli"
43 +SRC_URI="https://github.com/dandi/dandi-cli/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
44 +
45 +LICENSE="Apache-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86"
48 +IUSE="test etelemetry"
49 +
50 +RDEPEND="
51 + dev-python/appdirs[${PYTHON_USEDEP}]
52 + dev-python/click[${PYTHON_USEDEP}]
53 + dev-python/click-didyoumean[${PYTHON_USEDEP}]
54 + =dev-python/dandischema-0.5*[${PYTHON_USEDEP}]
55 + dev-python/fasteners[${PYTHON_USEDEP}]
56 + dev-python/fscacher[${PYTHON_USEDEP}]
57 + dev-python/humanize[${PYTHON_USEDEP}]
58 + dev-python/joblib[${PYTHON_USEDEP}]
59 + dev-python/keyring[${PYTHON_USEDEP}]
60 + dev-python/keyrings_alt[${PYTHON_USEDEP}]
61 + dev-python/packaging[${PYTHON_USEDEP}]
62 + dev-python/pycryptodome[${PYTHON_USEDEP}]
63 + dev-python/pydantic[${PYTHON_USEDEP}]
64 + dev-python/pynwb[${PYTHON_USEDEP}]
65 + dev-python/pyout[${PYTHON_USEDEP}]
66 + dev-python/python-dateutil[${PYTHON_USEDEP}]
67 + dev-python/requests[${PYTHON_USEDEP}]
68 + dev-python/ruamel-yaml[${PYTHON_USEDEP}]
69 + dev-python/semantic_version[${PYTHON_USEDEP}]
70 + dev-python/tenacity[${PYTHON_USEDEP}]
71 + dev-python/tqdm[${PYTHON_USEDEP}]
72 + dev-python/wheel[${PYTHON_USEDEP}]
73 +"
74 +
75 +DEPEND="
76 + test? (
77 + dev-python/anys[${PYTHON_USEDEP}]
78 + dev-python/responses[${PYTHON_USEDEP}]
79 + dev-python/pyfakefs[${PYTHON_USEDEP}]
80 + dev-python/pytest-mock[${PYTHON_USEDEP}]
81 + )
82 +"
83 +
84 +# Some tests require deep copy with git history
85 +# https://github.com/dandi/dandi-cli/issues/878#issuecomment-1021720299
86 +EPYTEST_DESELECT=(
87 + "dandi/tests/test_utils.py::test_get_instance_dandi_with_api"
88 + "dandi/tests/test_utils.py::test_get_instance_url"
89 + "dandi/tests/test_utils.py::test_get_instance_cli_version_too_old"
90 + "dandi/tests/test_utils.py::test_get_instance_bad_cli_version"
91 +)
92 +
93 +distutils_enable_tests pytest
94 +
95 +PATCHES=(
96 + "${FILESDIR}/${PN}-0.34.1-pip-versioncheck.patch"
97 + "${FILESDIR}/${PN}-0.35.0-test_nonetwork.patch"
98 +)
99 +
100 +src_prepare() {
101 + if use etelemetry; then
102 + default
103 + else
104 + eapply "${FILESDIR}/${PN}-0.28.0-no-etelemetry.patch"
105 + default
106 + sed -i "/etelemetry/d" setup.cfg
107 + fi
108 +}
109 +
110 +python_test() {
111 + export DANDI_TESTS_NONETWORK=1
112 + epytest
113 +}
114
115 diff --git a/dev-vcs/dandi-cli/dandi-cli-0.37.0.ebuild b/dev-vcs/dandi-cli/dandi-cli-0.37.0.ebuild
116 new file mode 100644
117 index 000000000..48c1627c3
118 --- /dev/null
119 +++ b/dev-vcs/dandi-cli/dandi-cli-0.37.0.ebuild
120 @@ -0,0 +1,86 @@
121 +# Copyright 1999-2022 Gentoo Authors
122 +# Distributed under the terms of the GNU General Public License v2
123 +
124 +EAPI=8
125 +
126 +DISTUTILS_USE_PEP517=setuptools
127 +PYTHON_COMPAT=( python3_{8..10} )
128 +
129 +inherit distutils-r1
130 +
131 +DESCRIPTION="DANDI command line client to facilitate common operations"
132 +HOMEPAGE="https://github.com/dandi/dandi-cli"
133 +SRC_URI="https://github.com/dandi/dandi-cli/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
134 +
135 +LICENSE="Apache-2.0"
136 +SLOT="0"
137 +KEYWORDS="~amd64 ~x86"
138 +IUSE="test etelemetry"
139 +
140 +RDEPEND="
141 + dev-python/appdirs[${PYTHON_USEDEP}]
142 + dev-python/click[${PYTHON_USEDEP}]
143 + dev-python/click-didyoumean[${PYTHON_USEDEP}]
144 + ~dev-python/dandischema-0.6.0[${PYTHON_USEDEP}]
145 + dev-python/fasteners[${PYTHON_USEDEP}]
146 + dev-python/fscacher[${PYTHON_USEDEP}]
147 + dev-python/humanize[${PYTHON_USEDEP}]
148 + dev-python/interleave[${PYTHON_USEDEP}]
149 + dev-python/joblib[${PYTHON_USEDEP}]
150 + dev-python/keyring[${PYTHON_USEDEP}]
151 + dev-python/keyrings_alt[${PYTHON_USEDEP}]
152 + dev-python/packaging[${PYTHON_USEDEP}]
153 + dev-python/pycryptodome[${PYTHON_USEDEP}]
154 + >=dev-python/pydantic-1.9.0[${PYTHON_USEDEP}]
155 + dev-python/pynwb[${PYTHON_USEDEP}]
156 + dev-python/pyout[${PYTHON_USEDEP}]
157 + dev-python/python-dateutil[${PYTHON_USEDEP}]
158 + dev-python/requests[${PYTHON_USEDEP}]
159 + dev-python/ruamel-yaml[${PYTHON_USEDEP}]
160 + dev-python/semantic_version[${PYTHON_USEDEP}]
161 + dev-python/tenacity[${PYTHON_USEDEP}]
162 + dev-python/wheel[${PYTHON_USEDEP}]
163 + dev-python/zarr[${PYTHON_USEDEP}]
164 +"
165 +
166 +DEPEND="
167 + test? (
168 + dev-python/anys[${PYTHON_USEDEP}]
169 + dev-python/responses[${PYTHON_USEDEP}]
170 + dev-python/pyfakefs[${PYTHON_USEDEP}]
171 + dev-python/pytest-mock[${PYTHON_USEDEP}]
172 + media-libs/opencv[ffmpeg,${PYTHON_USEDEP}]
173 + )
174 +"
175 +# Upstream might be amenable to dropping opencv:
176 +# https://github.com/dandi/dandi-cli/issues/944
177 +
178 +# Some tests require deep copy with git history
179 +# https://github.com/dandi/dandi-cli/issues/878#issuecomment-1021720299
180 +EPYTEST_DESELECT=(
181 + "dandi/tests/test_utils.py::test_get_instance_dandi_with_api"
182 + "dandi/tests/test_utils.py::test_get_instance_url"
183 + "dandi/tests/test_utils.py::test_get_instance_cli_version_too_old"
184 + "dandi/tests/test_utils.py::test_get_instance_bad_cli_version"
185 +)
186 +
187 +distutils_enable_tests pytest
188 +
189 +PATCHES=(
190 + "${FILESDIR}/${PN}-0.37.0-pip-versioncheck.patch"
191 +)
192 +
193 +src_prepare() {
194 + if use etelemetry; then
195 + default
196 + else
197 + eapply "${FILESDIR}/${PN}-0.28.0-no-etelemetry.patch"
198 + default
199 + sed -i "/etelemetry/d" setup.cfg
200 + fi
201 +}
202 +
203 +python_test() {
204 + export DANDI_TESTS_NONETWORK=1
205 + epytest
206 +}
207
208 diff --git a/dev-vcs/dandi-cli/dandi-cli-0.38.0.ebuild b/dev-vcs/dandi-cli/dandi-cli-0.38.0.ebuild
209 new file mode 100644
210 index 000000000..48c1627c3
211 --- /dev/null
212 +++ b/dev-vcs/dandi-cli/dandi-cli-0.38.0.ebuild
213 @@ -0,0 +1,86 @@
214 +# Copyright 1999-2022 Gentoo Authors
215 +# Distributed under the terms of the GNU General Public License v2
216 +
217 +EAPI=8
218 +
219 +DISTUTILS_USE_PEP517=setuptools
220 +PYTHON_COMPAT=( python3_{8..10} )
221 +
222 +inherit distutils-r1
223 +
224 +DESCRIPTION="DANDI command line client to facilitate common operations"
225 +HOMEPAGE="https://github.com/dandi/dandi-cli"
226 +SRC_URI="https://github.com/dandi/dandi-cli/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
227 +
228 +LICENSE="Apache-2.0"
229 +SLOT="0"
230 +KEYWORDS="~amd64 ~x86"
231 +IUSE="test etelemetry"
232 +
233 +RDEPEND="
234 + dev-python/appdirs[${PYTHON_USEDEP}]
235 + dev-python/click[${PYTHON_USEDEP}]
236 + dev-python/click-didyoumean[${PYTHON_USEDEP}]
237 + ~dev-python/dandischema-0.6.0[${PYTHON_USEDEP}]
238 + dev-python/fasteners[${PYTHON_USEDEP}]
239 + dev-python/fscacher[${PYTHON_USEDEP}]
240 + dev-python/humanize[${PYTHON_USEDEP}]
241 + dev-python/interleave[${PYTHON_USEDEP}]
242 + dev-python/joblib[${PYTHON_USEDEP}]
243 + dev-python/keyring[${PYTHON_USEDEP}]
244 + dev-python/keyrings_alt[${PYTHON_USEDEP}]
245 + dev-python/packaging[${PYTHON_USEDEP}]
246 + dev-python/pycryptodome[${PYTHON_USEDEP}]
247 + >=dev-python/pydantic-1.9.0[${PYTHON_USEDEP}]
248 + dev-python/pynwb[${PYTHON_USEDEP}]
249 + dev-python/pyout[${PYTHON_USEDEP}]
250 + dev-python/python-dateutil[${PYTHON_USEDEP}]
251 + dev-python/requests[${PYTHON_USEDEP}]
252 + dev-python/ruamel-yaml[${PYTHON_USEDEP}]
253 + dev-python/semantic_version[${PYTHON_USEDEP}]
254 + dev-python/tenacity[${PYTHON_USEDEP}]
255 + dev-python/wheel[${PYTHON_USEDEP}]
256 + dev-python/zarr[${PYTHON_USEDEP}]
257 +"
258 +
259 +DEPEND="
260 + test? (
261 + dev-python/anys[${PYTHON_USEDEP}]
262 + dev-python/responses[${PYTHON_USEDEP}]
263 + dev-python/pyfakefs[${PYTHON_USEDEP}]
264 + dev-python/pytest-mock[${PYTHON_USEDEP}]
265 + media-libs/opencv[ffmpeg,${PYTHON_USEDEP}]
266 + )
267 +"
268 +# Upstream might be amenable to dropping opencv:
269 +# https://github.com/dandi/dandi-cli/issues/944
270 +
271 +# Some tests require deep copy with git history
272 +# https://github.com/dandi/dandi-cli/issues/878#issuecomment-1021720299
273 +EPYTEST_DESELECT=(
274 + "dandi/tests/test_utils.py::test_get_instance_dandi_with_api"
275 + "dandi/tests/test_utils.py::test_get_instance_url"
276 + "dandi/tests/test_utils.py::test_get_instance_cli_version_too_old"
277 + "dandi/tests/test_utils.py::test_get_instance_bad_cli_version"
278 +)
279 +
280 +distutils_enable_tests pytest
281 +
282 +PATCHES=(
283 + "${FILESDIR}/${PN}-0.37.0-pip-versioncheck.patch"
284 +)
285 +
286 +src_prepare() {
287 + if use etelemetry; then
288 + default
289 + else
290 + eapply "${FILESDIR}/${PN}-0.28.0-no-etelemetry.patch"
291 + default
292 + sed -i "/etelemetry/d" setup.cfg
293 + fi
294 +}
295 +
296 +python_test() {
297 + export DANDI_TESTS_NONETWORK=1
298 + epytest
299 +}
300
301 diff --git a/dev-vcs/dandi-cli/files/dandi-cli-0.28.0-no-etelemetry.patch b/dev-vcs/dandi-cli/files/dandi-cli-0.28.0-no-etelemetry.patch
302 new file mode 100644
303 index 000000000..6822e1abf
304 --- /dev/null
305 +++ b/dev-vcs/dandi-cli/files/dandi-cli-0.28.0-no-etelemetry.patch
306 @@ -0,0 +1,30 @@
307 +--- a/dandi/utils.py 2021-09-21 11:51:39.799524534 -0400
308 ++++ b/dandi/utils.py 2021-10-06 04:58:00.506440719 -0400
309 +@@ -734,27 +734,4 @@
310 + def check_dandi_version():
311 + if os.environ.get("DANDI_NO_ET"):
312 + return
313 +- try:
314 +- import etelemetry
315 +-
316 +- try:
317 +- etelemetry.check_available_version(
318 +- "dandi/dandi-cli", __version__, lgr=lgr, raise_exception=True
319 +- )
320 +- except etelemetry.client.BadVersionError:
321 +- # note: SystemExit is based of BaseException, so is not Exception
322 +- raise SystemExit(
323 +- "DANDI CLI has detected that you are using a version that is known to "
324 +- "contain bugs, is incompatible with our current data archive, or has "
325 +- "other significant performance limitations. "
326 +- "To continue using DANDI CLI, please upgrade your dandi client to a newer "
327 +- "version (e.g., using pip install --upgrade dandi if you installed using pip). "
328 +- "If you have any issues, please contact the DANDI "
329 +- "helpdesk at https://github.com/dandi/helpdesk/issues/new/choose ."
330 +- )
331 +- except Exception as exc:
332 +- lgr.warning(
333 +- "Failed to check for a more recent version available with etelemetry: %s",
334 +- exc,
335 +- )
336 + os.environ["DANDI_NO_ET"] = "1"
337
338 diff --git a/dev-vcs/dandi-cli/files/dandi-cli-0.34.1-pip-versioncheck.patch b/dev-vcs/dandi-cli/files/dandi-cli-0.34.1-pip-versioncheck.patch
339 new file mode 100644
340 index 000000000..4595390b3
341 --- /dev/null
342 +++ b/dev-vcs/dandi-cli/files/dandi-cli-0.34.1-pip-versioncheck.patch
343 @@ -0,0 +1,13 @@
344 +--- a/setup.cfg 2021-10-06 11:44:40.549337707 -0400
345 ++++ b/dsetup.cfg 2021-10-06 11:45:10.236935245 -0400
346 +@@ -30,8 +30,8 @@
347 + appdirs
348 + click
349 + click-didyoumean
350 +- dandischema ~= 0.5.1
351 +- etelemetry >= 0.2.2
352 ++ dandischema
353 ++ etelemetry
354 + fasteners
355 + fscacher
356 + # Specifying != might be what causes pip 19.3.1 first to install hdmf 1.5.1
357
358 diff --git a/dev-vcs/dandi-cli/files/dandi-cli-0.35.0-test_nonetwork.patch b/dev-vcs/dandi-cli/files/dandi-cli-0.35.0-test_nonetwork.patch
359 new file mode 100644
360 index 000000000..89b48b21d
361 --- /dev/null
362 +++ b/dev-vcs/dandi-cli/files/dandi-cli-0.35.0-test_nonetwork.patch
363 @@ -0,0 +1,21 @@
364 +From e5a6dd4bdc4db828ea1de2a48e96cbdb80465e86 Mon Sep 17 00:00:00 2001
365 +From: "John T. Wodder II" <git@×××××××××.org>
366 +Date: Tue, 25 Jan 2022 18:53:53 -0500
367 +Subject: [PATCH] Mark a test with missing `skipif_no_network` marker
368 +
369 +---
370 + dandi/tests/test_metadata.py | 1 +
371 + 1 file changed, 1 insertion(+)
372 +
373 +diff --git a/dandi/tests/test_metadata.py b/dandi/tests/test_metadata.py
374 +index 5896e6ef..a0a6bce1 100644
375 +--- a/dandi/tests/test_metadata.py
376 ++++ b/dandi/tests/test_metadata.py
377 +@@ -351,6 +351,7 @@ def test_parseobourl(url, value):
378 + assert parse_purlobourl(url) == value
379 +
380 +
381 ++@××××.skipif_no_network
382 + def test_species():
383 + m = {"species": "http://purl.obolibrary.org/obo/NCBITaxon_28584"}
384 + assert extract_species(m).json_dict() == {
385
386 diff --git a/dev-vcs/dandi-cli/files/dandi-cli-0.37.0-pip-versioncheck.patch b/dev-vcs/dandi-cli/files/dandi-cli-0.37.0-pip-versioncheck.patch
387 new file mode 100644
388 index 000000000..bcc3853d3
389 --- /dev/null
390 +++ b/dev-vcs/dandi-cli/files/dandi-cli-0.37.0-pip-versioncheck.patch
391 @@ -0,0 +1,13 @@
392 +--- a/setup.cfg 2021-10-06 11:44:40.549337707 -0400
393 ++++ b/dsetup.cfg 2021-10-06 11:45:10.236935245 -0400
394 +@@ -30,8 +30,8 @@
395 + appdirs
396 + click
397 + click-didyoumean
398 +- dandischema ~= 0.6.0
399 +- etelemetry >= 0.2.2
400 ++ dandischema
401 ++ etelemetry
402 + fasteners
403 + fscacher
404 + # Specifying != might be what causes pip 19.3.1 first to install hdmf 1.5.1
405
406 diff --git a/dev-vcs/dandi-cli/metadata.xml b/dev-vcs/dandi-cli/metadata.xml
407 new file mode 100644
408 index 000000000..9565a2184
409 --- /dev/null
410 +++ b/dev-vcs/dandi-cli/metadata.xml
411 @@ -0,0 +1,26 @@
412 +<?xml version='1.0' encoding='UTF-8'?>
413 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
414 +<pkgmetadata>
415 + <maintainer type="person">
416 + <email>gentoo@×××××××.eu</email>
417 + <name>Horea Christian</name>
418 + </maintainer>
419 + <maintainer type="project">
420 + <email>sci@g.o</email>
421 + <name>Gentoo Science Project</name>
422 + </maintainer>
423 + <longdescription lang="en">
424 + This package provides a dandi command line utility with a basic interface
425 + which should assist you in preparing and uploading your data to and/or
426 + obtaining data from the http://dandiarchive.org . Each of the commands
427 + has a set of options to alter their behavior. Please run
428 + `dandi COMMAND --help` to get more information
429 + </longdescription>
430 + <use>
431 + <flag name="etelemetry">version checking to respect server schema version</flag>
432 + </use>
433 + <upstream>
434 + <remote-id type="github">dandi/dandi-cli</remote-id>
435 + <remote-id type="pypi">dandi</remote-id>
436 + </upstream>
437 +</pkgmetadata>