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/elasticsearch-py/
Date: Thu, 25 Aug 2022 19:25:28
Message-Id: 1661455400.896541b17f92df70e872c67e4062f1196ddf6633.arthurzam@gentoo
1 commit: 896541b17f92df70e872c67e4062f1196ddf6633
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 25 19:23:20 2022 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 25 19:23:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=896541b1
7
8 dev-python/elasticsearch-py: add 7.17.6
9
10 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
11
12 dev-python/elasticsearch-py/Manifest | 2 +
13 .../elasticsearch-py-7.17.6.ebuild | 193 +++++++++++++++++++++
14 2 files changed, 195 insertions(+)
15
16 diff --git a/dev-python/elasticsearch-py/Manifest b/dev-python/elasticsearch-py/Manifest
17 index 92dc576a65e2..9f2760a10e0c 100644
18 --- a/dev-python/elasticsearch-py/Manifest
19 +++ b/dev-python/elasticsearch-py/Manifest
20 @@ -1,2 +1,4 @@
21 DIST elasticsearch-7.14.1-no-jdk-linux-x86_64.tar.gz 191559419 BLAKE2B c4099d2e7a121b47549b44c081f60cd966a371a01827aa19380d171619cb6ef6f30fd411f75de00d41c6a93df2c899ac9dbc5cf2bf2264d7885ace6a61cf55c3 SHA512 77dca78ba865ae74863b3b2a3cd61e8a8e4478cd02eb020184dbf89fa32cf145a6bbd1d11a1cb88c2236a3b8cdb8b0047e3c0f1a40f609f31b898c905b2c211d
22 +DIST elasticsearch-7.17.6-no-jdk-linux-x86_64.tar.gz 167439665 BLAKE2B a0f2a57fbdd5bce1d476e410ec31555be7ebffa5961ad9b51d65753b50f05833e5991ee41c4b00906a8253146f72dc24895d5790a9d6afeea722d4b9b1a12443 SHA512 d3d1a16c2276d7ede911fc53915c988e17532a6481f9e4827677f6b40e6ccade6a9655a28bdb6460e98a4229f7cef807441e20afcdc161010f674ce1483da4f4
23 DIST elasticsearch-py-7.14.1.tar.gz 302277 BLAKE2B a4502edbaf1dbca9c687a32f012305fee7520555dd23f05888fcb8b82e2a9ffa3f9c5208320eca4ea8033498cd0a951003b94662b6847da664f302b8c2763004 SHA512 49b4e0cddc210e0d73cb7cb28f38dae4fd0595e22733cf017c41f50731479a1a3672307a119b067a0b5c1de3a138908e337145effd2b66bf930c2d439cd2ce0b
24 +DIST elasticsearch-py-7.17.6.gh.tar.gz 330159 BLAKE2B c72cf21ece1cc74c08f5f9a6718333bd89b6aece5902c4a053182bf63378b56afa84bb72cd7b07e7daba9eb19ac52f6c7f801124871cb4f555e456a66773218b SHA512 cb5f96e4e7a6c7a6bf52c55bcf3a4a3456574cea9815b002482a6e47a86c492d18aa85b3046ed6741361bd7e4e6fbc67c95a57b5a52e8320f102d3a5c1f4c719
25
26 diff --git a/dev-python/elasticsearch-py/elasticsearch-py-7.17.6.ebuild b/dev-python/elasticsearch-py/elasticsearch-py-7.17.6.ebuild
27 new file mode 100644
28 index 000000000000..bbcb13d1ca57
29 --- /dev/null
30 +++ b/dev-python/elasticsearch-py/elasticsearch-py-7.17.6.ebuild
31 @@ -0,0 +1,193 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +
39 +inherit distutils-r1
40 +
41 +DESCRIPTION="Official Python low-level client for Elasticsearch"
42 +HOMEPAGE="https://github.com/elastic/elasticsearch-py"
43 +SRC_URI="
44 + https://github.com/elastic/elasticsearch-py/archive/v${PV}.tar.gz
45 + -> ${P}.gh.tar.gz
46 + test? (
47 + https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${PV}-no-jdk-linux-x86_64.tar.gz
48 + )
49 +"
50 +
51 +LICENSE="Apache-2.0"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~x86"
54 +IUSE="async doc"
55 +
56 +PROPERTIES="test_network"
57 +RESTRICT="test"
58 +
59 +RDEPEND="
60 + dev-python/certifi[${PYTHON_USEDEP}]
61 + >=dev-python/urllib3-1.26.0[${PYTHON_USEDEP}]
62 + <dev-python/urllib3-2.0.0[${PYTHON_USEDEP}]
63 + async? (
64 + >=dev-python/aiohttp-3[${PYTHON_USEDEP}]
65 + <dev-python/aiohttp-4[${PYTHON_USEDEP}]
66 + )"
67 +BDEPEND="
68 + test? (
69 + >=dev-python/requests-2.0.0[${PYTHON_USEDEP}]
70 + <dev-python/requests-3.0.0[${PYTHON_USEDEP}]
71 + dev-python/aiohttp[${PYTHON_USEDEP}]
72 + dev-python/mock[${PYTHON_USEDEP}]
73 + dev-python/numpy[${PYTHON_USEDEP}]
74 + dev-python/pandas[${PYTHON_USEDEP}]
75 + dev-python/python-dateutil[${PYTHON_USEDEP}]
76 + >=dev-python/pyyaml-5.4[${PYTHON_USEDEP}]
77 + virtual/jre:*
78 + async? (
79 + dev-python/pytest-asyncio[${PYTHON_USEDEP}]
80 + dev-python/unasync[${PYTHON_USEDEP}]
81 + )
82 + )"
83 +
84 +distutils_enable_sphinx docs/sphinx \
85 + dev-python/sphinx_rtd_theme
86 +distutils_enable_tests pytest
87 +
88 +src_prepare() {
89 + default_src_prepare
90 +
91 + sed -e '/addopts/d' -i setup.cfg || die
92 +}
93 +
94 +src_test() {
95 + local es_port="25124"
96 +
97 + export ES_DIR="${WORKDIR}/elasticsearch-${PV}"
98 + export ES_INSTANCE="gentoo-es-py-test"
99 + export ES_JAVA_HOME=$(java-config -g JAVA_HOME || die)
100 + export ELASTIC_PASSWORD="changeme"
101 + export ELASTICSEARCH_URL="https://elastic:${ELASTIC_PASSWORD}@localhost:${es_port}"
102 +
103 + cp -r "${S}/.ci/certs" "${ES_DIR}/config" || die
104 +
105 + cat > "${ES_DIR}/config/elasticsearch.yml" <<-EOF || die
106 + # Run elasticsearch on custom port
107 + http.port: ${es_port}
108 + cluster.routing.allocation.disk.threshold_enabled: false
109 + bootstrap.memory_lock: true
110 + node.attr.testattr: test
111 + repositories.url.allowed_urls: http://snapshot.test*
112 + action.destructive_requires_name: false
113 + ingest.geoip.downloader.enabled: false
114 +
115 + xpack.license.self_generated.type: basic
116 + xpack.security.enabled: true
117 + xpack.security.http.ssl.enabled: true
118 + xpack.security.http.ssl.verification_mode: certificate
119 + xpack.security.http.ssl.key: certs/testnode.key
120 + xpack.security.http.ssl.certificate: certs/testnode.crt
121 + xpack.security.http.ssl.certificate_authorities: certs/ca.crt
122 + xpack.security.transport.ssl.enabled: true
123 + xpack.security.transport.ssl.verification_mode: certificate
124 + xpack.security.transport.ssl.key: certs/testnode.key
125 + xpack.security.transport.ssl.certificate: certs/testnode.crt
126 + xpack.security.transport.ssl.certificate_authorities: certs/ca.crt
127 + EOF
128 +
129 + # Set password in keystore
130 + printf "y\n${ELASTIC_PASSWORD}\n" | ${ES_DIR}/bin/elasticsearch-keystore add "bootstrap.password" || die
131 +
132 + # Deselect tests which require a non-free license in the server to succeed
133 + local EPYTEST_DESELECT=(
134 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[token/11_invalidation[{0,1}]
135 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[token/10_basic[{1..4}]
136 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_record[{1..6}]
137 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_influencer[{1..8}]
138 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/datafeed_cat_apis[0]
139 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/filter_crud[10]
140 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/preview_data_frame_analytics[{3..5}]
141 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/custom_all_field[{0,1}]
142 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/data_frame_analytics_crud[{1,5,6,13,29,38,39,40,42,62,76,77,78,80,81,82,83}]
143 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/start_data_frame_analytics[{0,1,2,3,4,6,7,8}]
144 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_categories[{0,1,2,3,4,5,6,7}]
145 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/forecast[{1,2,3,4,5,6}]
146 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/explain_data_frame_analytics[{3,5,6,7,8}]
147 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/delete_expired_data[{0,1,2,3}]
148 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/upgrade_job_snapshot[{0,1}]
149 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/inference_processor[{0,1}]
150 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_buckets[{0,1,2,3,4,5,6,7,8,9,10,11}]
151 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/trained_model_cat_apis[0]
152 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/revert_model_snapshot[{0,1}]
153 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/calendar_crud[{0,7,8,12,13,17,18}]
154 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/stop_data_frame_analytics[{0,1,2,3,4,5}]
155 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get[{0,1,2,3,4}]
156 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/preview_datafeed[{0,1,2,3,7,8,9}]
157 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/data_frame_analytics_cat_apis[{0,1,2,3}]
158 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/reset_job[{0,1}]
159 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/ml_anomalies_default_mappings[{0,1}]
160 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/get_model_snapshots[{0,1,2,3,4,5,6,7}]
161 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/get_datafeeds[{0,1,2,3}]
162 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/job_cat_apis[0]
163 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[change_password/11_token[0]
164 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[searchable_snapshots/10_usage[0]
165 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[graph/10_basic[0]
166 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[data_stream/10_data_stream_resolvability[4]
167 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[xpack/20_info[0]
168 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[authenticate/10_field_level_security[0]
169 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[set_security_user/10_small_users_one_index[0]
170 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[terms_enum/10_basic[{0..9}]
171 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[security/hidden-index/14_security-tokens-7_read[{0,1,2}]
172 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[security/hidden-index/13_security-tokens_read[{0,1,2}]
173 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_records[{0..6}]
174 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[ml/jobs_get_result_influencers[{0..8}]
175 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[license/20_put_license[{5,7,8}]
176 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[license/30_enterprise_license[0]
177 + test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[token/10_basic[0]
178 + )
179 +
180 + use async || EPYTEST_DESELECT+=(
181 + test_elasticsearch/test_async test_elasticsearch/test_types/async_types.py
182 + )
183 +
184 + distutils-r1_src_test
185 +}
186 +
187 +python_test() {
188 + local es_instance="gentoo-py-test"
189 + local es_log="${ES_DIR}/logs/${es_instance}-${EPYTHON}.log"
190 + local es_temp="${T}/es_temp-${EPYTHON}"
191 + local pid="${ES_DIR}/elasticsearch.pid"
192 +
193 + mkdir ${es_temp} || die
194 +
195 + ebegin "Starting Elasticsearch for ${EPYTHON}"
196 +
197 + # start local instance of elasticsearch
198 + "${ES_DIR}"/bin/elasticsearch -d -p "${pid}" -Ecluster.name="${es_instance}-${EPYTHON}" -Epath.repo="${es_temp}" || die
199 +
200 + local i es_started=0
201 + for i in {1..20}; do
202 + grep -q "started" ${es_log} 2> /dev/null
203 + if [[ $? -eq 0 ]]; then
204 + einfo "Elasticsearch started"
205 + es_started=1
206 + eend 0
207 + break
208 + elif grep -q 'BindException\[Address already in use\]' "${es_log}" 2>/dev/null; then
209 + eend 1
210 + eerror "Elasticsearch already running"
211 + die "Cannot start Elasticsearch for tests"
212 + else
213 + einfo "Waiting for Elasticsearch"
214 + sleep 2
215 + continue
216 + fi
217 + done
218 +
219 + [[ ${es_started} -eq 0 ]] && die "Elasticsearch failed to start"
220 +
221 + epytest
222 +
223 + pkill -F ${pid} || die
224 +}