Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/elasticsearch-py/
Date: Mon, 19 Aug 2019 17:06:10
Message-Id: 1566234353.b2ed75e2a976ddb9239067a519c4828f1c2ab8cb.juippis@gentoo
1 commit: b2ed75e2a976ddb9239067a519c4828f1c2ab8cb
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Aug 16 15:04:33 2019 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 19 17:05:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2ed75e2
7
8 dev-python/elasticsearch-py: bump to 6.4.0
9
10 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
11 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
12
13 dev-python/elasticsearch-py/Manifest | 1 +
14 .../elasticsearch-py/elasticsearch-py-6.4.0.ebuild | 95 ++++++++++++++++++++++
15 2 files changed, 96 insertions(+)
16
17 diff --git a/dev-python/elasticsearch-py/Manifest b/dev-python/elasticsearch-py/Manifest
18 index b260c9817c4..966d7df8815 100644
19 --- a/dev-python/elasticsearch-py/Manifest
20 +++ b/dev-python/elasticsearch-py/Manifest
21 @@ -1,2 +1,3 @@
22 DIST elasticsearch-oss-6.4.0.tar.gz 33727061 BLAKE2B dd0ff95bb124103ca340b480c5192c9919ef226d4c3ef1b61accd0df2ee9b60a8215693b3db0fa327a4d6791de66746654144a9172210687e8a2efa9f6f4dde3 SHA512 0197dcf24bdb81cbcfa492d899363528816143962abd1925a5092e8177c25e8ca490afe5868b41057b3cded296f59f38ed11ba0156a820b6c877c69a5888846c
23 DIST elasticsearch-py-6.3.1.tar.gz 90047 BLAKE2B 765d0a34bd22067e07f4e862eb72f2b67bd0db3516abdf76cdc0d4f24de3db6941b4dbc6afb6315667d640514415cf08ff6de127c84ab36ef9bf062d4e687d55 SHA512 b975a6b446b760bf62289e855768a26b9e104aba9cd399cf275f59f2755efa00bd55c99a746751dad2f7a18f581a1b124c1bb9b91f5c3dc9fb00138c9d198aea
24 +DIST elasticsearch-py-6.4.0.tar.gz 97217 BLAKE2B 376768fab9bd7b4efd98f8cc24d4bad700f9bd2f9013a794e28986ee80463e5854399124bfde43a9a43d6773ee5e546fc28077452d2daab6e2e25810c045a986 SHA512 bb9a2fad3ca002b25fa58585cffdadf847a078f72a5b24297d58e1d598103cb38155ff61fd5802be8ccfec96daec3119ecb490f876c07263f103fbf26f6dc6d4
25
26 diff --git a/dev-python/elasticsearch-py/elasticsearch-py-6.4.0.ebuild b/dev-python/elasticsearch-py/elasticsearch-py-6.4.0.ebuild
27 new file mode 100644
28 index 00000000000..b941a308a92
29 --- /dev/null
30 +++ b/dev-python/elasticsearch-py/elasticsearch-py-6.4.0.ebuild
31 @@ -0,0 +1,95 @@
32 +# Copyright 1999-2019 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +PYTHON_COMPAT=( python2_7 python3_{5,6} pypy )
38 +ES_VERSION="6.4.0"
39 +
40 +inherit distutils-r1
41 +
42 +MY_PN=${PN/-py/}
43 +DESCRIPTION="Official Python low-level client for Elasticsearch"
44 +HOMEPAGE="https://github.com/elastic/elasticsearch-py"
45 +SRC_URI="https://github.com/elasticsearch/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
46 + test? ( https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-${ES_VERSION}.tar.gz )"
47 +
48 +LICENSE="Apache-2.0"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~x86"
51 +IUSE="doc examples test"
52 +
53 +# tests fail in chroot
54 +# https://github.com/elastic/elasticsearch/issues/12018
55 +RESTRICT="test"
56 +
57 +RDEPEND=">=dev-python/urllib3-1.21.1[${PYTHON_USEDEP}]"
58 +
59 +DEPEND="test? ( ${RDEPEND}
60 + >=dev-python/requests-2.0.0[${PYTHON_USEDEP}]
61 + <dev-python/requests-3.0.0[${PYTHON_USEDEP}]
62 + dev-python/nose[${PYTHON_USEDEP}]
63 + dev-python/coverage[${PYTHON_USEDEP}]
64 + dev-python/mock[${PYTHON_USEDEP}]
65 + dev-python/pretty-yaml[${PYTHON_USEDEP}]
66 + dev-python/nosexcover[${PYTHON_USEDEP}]
67 + virtual/jre:1.8 )"
68 +
69 +BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
70 + >=dev-python/sphinx-1.3.1-r1[${PYTHON_USEDEP}]"
71 +
72 +python_compile_all() {
73 + emake -C docs -j1 man $(usex doc html "")
74 +}
75 +
76 +# FEATURES="test -usersandbox" emerge dev-python/elasticsearch-py
77 +python_test() {
78 + ES="${WORKDIR}/elasticsearch-${ES_VERSION}"
79 + ES_PORT="25124"
80 + ES_INSTANCE="gentoo-es-py-test"
81 + ES_LOG="${ES}/logs/${ES_INSTANCE}.log"
82 + PID="${ES}/elasticsearch.pid"
83 +
84 + # run Elasticsearch instance on custom port
85 + sed -i "s/#http.port: 9200/http.port: ${ES_PORT}/g; \
86 + s/#cluster.name: my-application/cluster.name: ${ES_INSTANCE}/g" \
87 + "${ES}/config/elasticsearch.yml" || die
88 +
89 + # start local instance of elasticsearch
90 + "${ES}"/bin/elasticsearch -d -p "${PID}" -Epath.repo=/ || die
91 +
92 + local i
93 + local es_started=0
94 + for i in {1..20}; do
95 + grep -q "started" ${ES_LOG} 2> /dev/null
96 + if [[ $? -eq 0 ]]; then
97 + einfo "Elasticsearch started"
98 + es_started=1
99 + eend 0
100 + break
101 + elif grep -q 'BindException\[Address already in use\]' "${ES_LOG}" 2>/dev/null; then
102 + eend 1
103 + eerror "Elasticsearch already running"
104 + die "Cannot start Elasticsearch for tests"
105 + else
106 + einfo "Waiting for Elasticsearch"
107 + eend 1
108 + sleep 2
109 + continue
110 + fi
111 + done
112 +
113 + [[ $es_started -eq 0 ]] && die "Elasticsearch failed to start"
114 +
115 + export TEST_ES_SERVER="localhost:${ES_PORT}"
116 + esetup.py test || die
117 +
118 + pkill -F ${PID} || die
119 +}
120 +
121 +python_install_all() {
122 + use doc && HTML_DOCS=( docs/_build/html/. )
123 + use examples && dodoc -r example
124 + doman docs/_build/man/*
125 + distutils-r1_python_install_all
126 +}