Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-misc/buku/files/, www-misc/buku/
Date: Fri, 04 Sep 2020 21:27:58
Message-Id: 1599254867.9ebb9d39bd889b7892ccb9f4b218c02fae065658.sam@gentoo
1 commit: 9ebb9d39bd889b7892ccb9f4b218c02fae065658
2 Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net>
3 AuthorDate: Thu Jul 23 05:41:21 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 4 21:27:47 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ebb9d39
7
8 www-misc/buku: Bump to 4.4
9
10 Closes: https://bugs.gentoo.org/675618
11 Closes: https://bugs.gentoo.org/684056
12 Closes: https://bugs.gentoo.org/684566
13 Package-Manager: Portage-3.0.0, Repoman-2.3.23
14 Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net>
15 Closes: https://github.com/gentoo/gentoo/pull/16786
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 www-misc/buku/Manifest | 1 +
19 www-misc/buku/buku-4.4.ebuild | 86 ++++++++++++++++++++++++++++
20 www-misc/buku/files/buku-4.4-fix-tests.patch | 34 +++++++++++
21 3 files changed, 121 insertions(+)
22
23 diff --git a/www-misc/buku/Manifest b/www-misc/buku/Manifest
24 index c6d6200e6a6..3e4a4ad721d 100644
25 --- a/www-misc/buku/Manifest
26 +++ b/www-misc/buku/Manifest
27 @@ -1 +1,2 @@
28 DIST buku-4.3.tar.gz 264480 BLAKE2B 8bddf640512e5741f80bb5bc073208d843cac32d3c3ade0bdf36241e93d6c81d47238ad03c651e924226933efa572e65d9a4c86f861acda68935c9e96d6e6fb4 SHA512 eabf45b1cc1700b20f2a95baf14940f49e2a2ad51aef0f870c488e67cb07fb110916d93037830cd83572317c5d0a8b05c0a5732f105face2a14facf6af02b690
29 +DIST buku-4.4.tar.gz 273207 BLAKE2B bff849f03ba6b2f8779a9445da26f64875ccc6a7cb1434cba51237742a7b9968d302ee0dd9f87fd2857922660fc304d07012a962c080704d7d99312e8672e4d0 SHA512 5ccd3e72b2256d4d3daf007ffc9279c9958eec6a5baa913cb31bf97d978db227e28311f882a930da737c002ec0750ee9f8cf0f7584e639154398ba5d486bd8ba
30
31 diff --git a/www-misc/buku/buku-4.4.ebuild b/www-misc/buku/buku-4.4.ebuild
32 new file mode 100644
33 index 00000000000..a626d1b8027
34 --- /dev/null
35 +++ b/www-misc/buku/buku-4.4.ebuild
36 @@ -0,0 +1,86 @@
37 +# Copyright 1999-2020 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +
42 +PYTHON_COMPAT=( python3_{6,7,8} )
43 +DISTUTILS_USE_SETUPTOOLS=rdepend
44 +
45 +inherit bash-completion-r1 distutils-r1
46 +
47 +DESCRIPTION="Powerful command-line bookmark manager"
48 +HOMEPAGE="https://github.com/jarun/buku"
49 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
50 +
51 +LICENSE="GPL-3"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~x86"
54 +IUSE="test"
55 +RESTRICT="!test? ( test )"
56 +
57 +PATCHES=( "${FILESDIR}/${P}-fix-tests.patch" )
58 +
59 +RDEPEND="
60 + >=dev-python/beautifulsoup-4.6.0[${PYTHON_USEDEP}]
61 + dev-python/cryptography[${PYTHON_USEDEP}]
62 + >=dev-python/html5lib-1.0.1[${PYTHON_USEDEP}]
63 + dev-python/urllib3[${PYTHON_USEDEP}]
64 +"
65 +DEPEND="${RDEPEND}
66 + test? (
67 + dev-python/attrs[${PYTHON_USEDEP}]
68 + >=dev-python/click-7.0[${PYTHON_USEDEP}]
69 + dev-python/hypothesis[${PYTHON_USEDEP}]
70 + >=dev-python/py-1.5.0[${PYTHON_USEDEP}]
71 + dev-python/pytest[${PYTHON_USEDEP}]
72 + >=dev-python/pyyaml-4.2[${PYTHON_USEDEP}]
73 + >=dev-python/vcrpy-4.0.2[${PYTHON_USEDEP}]
74 + )
75 +"
76 +
77 +python_prepare_all() {
78 + # Remove support for bukuserver - complex depgraph which isn't all
79 + # sufficiently packaged in Gentoo
80 + sed -ie '/console_scripts/s/,.*/]/' setup.py || die
81 + sed -ie 's/.*bukuserver.*//' tests/test_views.py || die
82 + sed -ie 's/.*flask.*//' tests/test_views.py || die
83 +
84 + distutils-r1_python_prepare_all
85 +}
86 +
87 +python_install_all() {
88 + distutils-r1_python_install_all
89 +
90 + insinto /usr/share/zsh/site-functions
91 + doins auto-completion/zsh/_*
92 +
93 + newbashcomp auto-completion/bash/buku-completion.bash "${PN}"
94 +
95 + doman buku.1
96 +}
97 +
98 +python_test() {
99 + local skipped_tests=(
100 + # Disable tests related to bukuserver
101 + tests/test_views.py::test_load_firefox_database
102 + tests/test_views.py::test_tag_model_view_get_list_empty_db
103 + tests/test_views.py::test_tag_model_view_get_list
104 + tests/test_views.py::test_bookmark_model_view
105 + tests/test_setup.py::test_bukuserver_requirement
106 +
107 + # Broken with network-sandbox
108 + tests/test_bukuDb.py::test_load_firefox
109 + tests/test_bukuDb.py::test_add_rec_exec_arg
110 + tests/test_buku.py::test_network_handler_with_url
111 + tests/test_bukuDb.py::TestBukuDb::test_tnyfy_url
112 + tests/test_bukuDb.py::test_refreshdb
113 + tests/test_bukuDb.py::test_print_rec_hypothesis
114 +
115 + # Passes when called alone, fails when run from the suite,
116 + # but only when the network is disabled
117 + tests/test_bukuDb.py::test_delete_rec_index_and_delay_commit[1-True-False]
118 + )
119 +
120 + # tests/test_server.py is bukuserver tests, ignore it
121 + pytest -v --ignore tests/test_server.py ${skipped_tests[@]/#/--deselect } || die "Tests failed with ${EPYTHON}"
122 +}
123
124 diff --git a/www-misc/buku/files/buku-4.4-fix-tests.patch b/www-misc/buku/files/buku-4.4-fix-tests.patch
125 new file mode 100644
126 index 00000000000..0ef0f25228c
127 --- /dev/null
128 +++ b/www-misc/buku/files/buku-4.4-fix-tests.patch
129 @@ -0,0 +1,34 @@
130 +Upstream: https://github.com/jarun/buku/pull/462/commits/9ecf8857d74f51666ba2ea40344c8ba99accccb8
131 +
132 +From 9ecf8857d74f51666ba2ea40344c8ba99accccb8 Mon Sep 17 00:00:00 2001
133 +From: rachmadaniHaryono <foreturiga@×××××.com>
134 +Date: Thu, 6 Aug 2020 14:52:31 +0800
135 +Subject: [PATCH] fix: test: delete_rec
136 +
137 +---
138 + tests/test_bukuDb.py | 6 ++----
139 + 1 file changed, 2 insertions(+), 4 deletions(-)
140 +
141 +diff --git a/tests/test_bukuDb.py b/tests/test_bukuDb.py
142 +index 7e798b3..8b56331 100644
143 +--- a/tests/test_bukuDb.py
144 ++++ b/tests/test_bukuDb.py
145 +@@ -936,16 +936,14 @@ def test_delete_rec_on_non_interger(index, low, high, is_range):
146 +
147 + for bookmark in TEST_BOOKMARKS:
148 + bdb.add_rec(*bookmark)
149 +- db_len = len(TEST_BOOKMARKS)
150 +
151 + if is_range and not (isinstance(low, int) and isinstance(high, int)):
152 + with pytest.raises(TypeError):
153 + bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
154 + return
155 + if not is_range and not isinstance(index, int):
156 +- res = bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
157 +- assert not res
158 +- assert len(bdb.get_rec_all()) == db_len
159 ++ with pytest.raises(TypeError):
160 ++ bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
161 + else:
162 + assert bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
163 +