summaryrefslogtreecommitdiff
path: root/dev-python/elasticsearch-py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-18 08:10:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-18 08:10:15 +0000
commitfceeb864f5e0e6155b3f5ed010298e5b7b2f1278 (patch)
treeeae9568ab98ccfbd977dade72fecdd45c670fc9d /dev-python/elasticsearch-py
parent517343fddd94e620e94be97ae22eca4b57dc7625 (diff)
gentoo auto-resync : 18:02:2023 - 08:10:15
Diffstat (limited to 'dev-python/elasticsearch-py')
-rw-r--r--dev-python/elasticsearch-py/Manifest6
-rw-r--r--dev-python/elasticsearch-py/elasticsearch-py-7.17.9.ebuild183
-rw-r--r--dev-python/elasticsearch-py/elasticsearch-py-8.6.2.ebuild150
3 files changed, 339 insertions, 0 deletions
diff --git a/dev-python/elasticsearch-py/Manifest b/dev-python/elasticsearch-py/Manifest
index d13a983bfd84..b77812fe4e6c 100644
--- a/dev-python/elasticsearch-py/Manifest
+++ b/dev-python/elasticsearch-py/Manifest
@@ -1,4 +1,10 @@
DIST elasticsearch-7.17.6-no-jdk-linux-x86_64.tar.gz 167439665 BLAKE2B a0f2a57fbdd5bce1d476e410ec31555be7ebffa5961ad9b51d65753b50f05833e5991ee41c4b00906a8253146f72dc24895d5790a9d6afeea722d4b9b1a12443 SHA512 d3d1a16c2276d7ede911fc53915c988e17532a6481f9e4827677f6b40e6ccade6a9655a28bdb6460e98a4229f7cef807441e20afcdc161010f674ce1483da4f4
+DIST elasticsearch-7.17.9-linux-x86_64.tar.gz 315244963 BLAKE2B d08e99a857de9cf3b2d1db4b1788c7340b0efdfe2e0b0ea0ed172a4c13dfafb67d6337e18f65ee7dedb217296ef4aff01dcf8a47c8855504fb2249ac48f0d5a2 SHA512 f49d8fce010db83e6a89462535c71ba11a1153589038a7db430fc7db44178a55d5538dea80e6d4c690f4f0e838168965297c6a3ae31fbc5020af4d966067a90c
+DIST elasticsearch-8.6.2-linux-x86_64.tar.gz 581745209 BLAKE2B c5d76e8fd2b7b28d50a0b81950c5d824f5000d3239efef9c3312e153829f09d98ba1394dceff2f147c29e2cd24be2ea4aaf0e0dc830e51989b87c8c7b48e3b3c SHA512 4c5ea98af53861d6c7f06f855f3bd4f4f52136d8149347e43f633a23ba56d3237f6ff7346bf849090f4e52b28fc21c98df8d9b0f0f845a330834367705cd366a
DIST elasticsearch-py-7.17.6.gh.tar.gz 330159 BLAKE2B c72cf21ece1cc74c08f5f9a6718333bd89b6aece5902c4a053182bf63378b56afa84bb72cd7b07e7daba9eb19ac52f6c7f801124871cb4f555e456a66773218b SHA512 cb5f96e4e7a6c7a6bf52c55bcf3a4a3456574cea9815b002482a6e47a86c492d18aa85b3046ed6741361bd7e4e6fbc67c95a57b5a52e8320f102d3a5c1f4c719
+DIST elasticsearch-py-7.17.9.gh.tar.gz 330550 BLAKE2B 09f468e94408646cf8fe182137c50253852bdf4c79c2d6d90774bbc13f7c1ed1b08a5c52298873e986d8863b24527350ac0ec06b463047cb3b605573c732e0d9 SHA512 c05f22b5083da01833fbcfa4c0446efb19d0a8e5b541a07b8126c0597e6d513c2f5ead14f6d01d0f5ab29a7d20bcf80213576690fd66daa337ea555c6eaafae5
+DIST elasticsearch-py-8.6.2.gh.tar.gz 517674 BLAKE2B c498f1e1efaea4c24f595f7e496f576372d6075da107b2f84a7d4a42c02de4e00d1459df6f965384f5880b4d8f910c4a7a49a773cb38361618ca7a74e5c4ec5a SHA512 53c03c9c8da4eb303e8f9cd5752bbef5a360d1e1a6fea4e98a8d576299f2ae4175c1da09429049cedf53a78bf86a4647fe4f4f9c7735a5a29977ada7db49e5fb
EBUILD elasticsearch-py-7.17.6.ebuild 9104 BLAKE2B b5e28f2d1d8d31c03b0bb783a7c7eb3a30893b019db3a722eae466c565461ff622117644ae570d6cebea1b05f1dbce40399c0b62123a360ab0b78bc25bcc77c4 SHA512 60bd5375467d590be4125c6f98aac445af239de27e0f3ee1cb45b9a7fd105960b43918077f4c3e43de730dee10ccd13a93c0b20c715a92f1fd947e5239453aa7
+EBUILD elasticsearch-py-7.17.9.ebuild 7321 BLAKE2B a43ebe5d65492d589cdace2803772ef69327e0ec5503d65313e02b509e121ccba2b93cd2148fdb18b927a38b4984250ead7794c565d5bd742fdc8da1333e68df SHA512 3e1287b36e8a885daefc5165d9bc5e5128d4db21097514be88405f223e02a73302fd8e2a3416bfd62ca6c43b6c99dac26753c4221aa575072436ad51a443cbe8
+EBUILD elasticsearch-py-8.6.2.ebuild 4848 BLAKE2B 9a2bb73f3d639ea82bad068ee6c4094d57fb3ce60ce72960f9065d51022bc28fe30c466f369f3912ffc68ecb922920f63a5cec6fa2344844edeecb1f545a4528 SHA512 99b70946e90272fd3edd2dcc8946558b3f27262869d56b95c4a377f4a358513c1b602a1c08abf0481d8496a717d2726831e8eb2fd9991e379fa688e9a78f617a
MISC metadata.xml 601 BLAKE2B 56345ee1f417174399c98b5ed5ce11557b555a5ff8427bde703a455cfb6af71c3e56edf6f778981dd2684d74910f632f7a079a72b005e666fc35577943b4f500 SHA512 546374a9ba457b0f02b142d92daba3dccf39abc53f75bae9ace0a2f05187e6ff7eba7b1c3cd228176006a329e0ec403adbe51d24841c58c47479b000d41941b4
diff --git a/dev-python/elasticsearch-py/elasticsearch-py-7.17.9.ebuild b/dev-python/elasticsearch-py/elasticsearch-py-7.17.9.ebuild
new file mode 100644
index 000000000000..909205de40ea
--- /dev/null
+++ b/dev-python/elasticsearch-py/elasticsearch-py-7.17.9.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+inherit distutils-r1
+
+DESCRIPTION="Official Elasticsearch client library for Python"
+HOMEPAGE="
+ https://ela.st/es-python
+ https://github.com/elastic/elasticsearch-py
+ https://pypi.org/project/elasticsearch/
+"
+# Use bundled jdk for the test elasticsearch as there is no convenient way to ensure system jdk17 is used
+SRC_URI="
+ https://github.com/elastic/elasticsearch-py/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
+ test? (
+ amd64? ( https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${PV}-linux-x86_64.tar.gz )
+ )
+"
+
+LICENSE="Apache-2.0"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~amd64 ~x86"
+
+RESTRICT="
+ !amd64? ( test )
+ !test? ( test )
+"
+
+RDEPEND="
+ >=dev-python/aiohttp-3[${PYTHON_USEDEP}] <dev-python/aiohttp-4[${PYTHON_USEDEP}]
+ dev-python/certifi[${PYTHON_USEDEP}]
+ >=dev-python/urllib3-1.21.1[${PYTHON_USEDEP}] <dev-python/urllib3-2[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ ${RDEPEND}
+ dev-python/mapbox-vector-tile[${PYTHON_USEDEP}]
+ dev-python/multidict[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pandas[${PYTHON_USEDEP}]
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.4[${PYTHON_USEDEP}]
+ >=dev-python/requests-2[${PYTHON_USEDEP}] <dev-python/requests-3[${PYTHON_USEDEP}]
+ dev-python/unasync[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_IGNORE=(
+ # REST api tests are a black hole for effort. It downloads the tests so its an ever moving target
+ # It also requires effort to blacklist tests for apis which are license restricted.
+ "test_elasticsearch/test_server/test_rest_api_spec.py"
+ # Counting deprecation warnings from python is bound to fail even if all are fixed in this package
+ # Not worth it
+ "test_elasticsearch/test_client/test_deprecated_options.py"
+ # Requires a network connection. I could've used PROPERTIES=test_network,
+ # but it would complicate the RESTRICT statement with the elasticsearch binary being limited to amd64 and arm64
+ "test_elasticsearch/test_connection.py"
+ "test_elasticsearch/test_async/test_connection.py"
+)
+
+EPYTEST_DESELECT=(
+ # Not motivated to figure these out, upstream CI doesnt test with the daemon running so it hasnt been caught there
+
+ ## elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception',
+ ## 'index [.ds-ilm-history-5-2023.02.17-000001] is the write index for data stream [ilm-history-5] and cannot be deleted')
+ "test_elasticsearch/test_server/test_clients.py::TestUnicode::test_indices_analyze"
+ ## elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception',
+ ## 'unable to remove composable templates [.deprecation-indexing-template] as they are in use by a data streams [.logs-deprecation.elasticsearch-default]')
+ "test_elasticsearch/test_async/test_server/test_helpers.py::TestAsyncDataStreamReindex::test_reindex_index_datastream[create]"
+ ## elasticsearch.exceptions.NotFoundError: NotFoundError(404, 'index_template_missing_exception',
+ ## 'index_template [.deprecation-indexing-template] missing')
+ "test_elasticsearch/test_async/test_server/test_helpers.py::TestScan::test_scan_auth_kwargs_forwarded"
+ ## elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception',
+ ## 'Cannot delete policy [.deprecation-indexing-ilm-policy]. It is in use by one or more indices:
+ ## [.ds-.logs-deprecation.elasticsearch-default-2023.02.17-000001]')
+ "test_elasticsearch/test_async/test_server/test_helpers.py::TestParentChildReindex::test_children_are_reindexed_correctly"
+ ## elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception',
+ ## 'Cannot delete policy [.deprecation-indexing-ilm-policy]. It is in use by one or more indices:
+ ## [.ds-.logs-deprecation.elasticsearch-default-2023.02.17-000001]')
+ "test_elasticsearch/test_async/test_server/test_helpers.py::TestAsyncDataStreamReindex::test_reindex_index_datastream_op_type_index"
+)
+
+distutils_enable_sphinx docs/sphinx dev-python/sphinx-rtd-theme
+distutils_enable_tests pytest
+
+src_prepare() {
+ # Replace added pytest options with setting asyncio_mode to auto.
+ # Test suite hasnt set asyncio parameters so its needed here.
+ sed -i '/[tool:pytest]/,/^$/ { s/addopts.*/asyncio_mode = auto/ }' setup.cfg || die
+
+ # Catches warnings from other tests causing the assertation to fail unduly
+ sed -i '/TestStreamingBulk/,/class/ { /test_all_documents_get_inserted/,/async def/ { /assert w == \[\]/ d } }' \
+ test_elasticsearch/test_async/test_server/test_helpers.py || die
+
+ default
+}
+
+src_test() {
+ local es_port="25124"
+
+ export ES_DIR="${WORKDIR}/elasticsearch-${PV}"
+ export ES_INSTANCE="gentoo-es-py-test"
+ export ELASTIC_PASSWORD="changeme"
+ export ELASTICSEARCH_URL="https://elastic:${ELASTIC_PASSWORD}@localhost:${es_port}"
+
+ # Default behavior sets these depending on available memory.
+ # On my system its not reliable and leads to an instant OOM :D
+ # So lets add a reasonable limit
+ export ES_JAVA_OPTS="-Xmx4g"
+
+ cp -r "${S}/.ci/certs" "${ES_DIR}/config" || die
+
+ cat > "${ES_DIR}/config/elasticsearch.yml" <<-EOF || die
+ # Run elasticsearch on custom port
+ http.port: ${es_port}
+ cluster.routing.allocation.disk.threshold_enabled: false
+ bootstrap.memory_lock: true
+ node.attr.testattr: test
+ repositories.url.allowed_urls: http://snapshot.test*
+ action.destructive_requires_name: false
+ ingest.geoip.downloader.enabled: false
+
+ xpack.license.self_generated.type: basic
+ xpack.security.enabled: true
+ xpack.security.http.ssl.enabled: true
+ xpack.security.http.ssl.verification_mode: certificate
+ xpack.security.http.ssl.key: certs/testnode.key
+ xpack.security.http.ssl.certificate: certs/testnode.crt
+ xpack.security.http.ssl.certificate_authorities: certs/ca.crt
+ xpack.security.transport.ssl.enabled: true
+ xpack.security.transport.ssl.verification_mode: certificate
+ xpack.security.transport.ssl.key: certs/testnode.key
+ xpack.security.transport.ssl.certificate: certs/testnode.crt
+ xpack.security.transport.ssl.certificate_authorities: certs/ca.crt
+ EOF
+
+ # Set password in keystore
+ printf "y\n${ELASTIC_PASSWORD}\n" | ${ES_DIR}/bin/elasticsearch-keystore add "bootstrap.password" || die
+
+ local es_instance="gentoo-py-test"
+ local es_log="${ES_DIR}/logs/${es_instance}.log"
+ local es_temp="${T}/es_temp"
+ local pid="${ES_DIR}/elasticsearch.pid"
+
+ mkdir ${es_temp} || die
+
+ ebegin "Starting Elasticsearch for ${EPYTHON}"
+
+ # start local instance of elasticsearch
+ "${ES_DIR}"/bin/elasticsearch -d -v -p "${pid}" \
+ -Ecluster.name="${es_instance}" -Epath.repo="${es_temp}" || die
+
+ local i es_started=0
+ for i in {1..20}; do
+ grep -q "\] started" ${es_log} 2> /dev/null
+ if [[ $? -eq 0 ]]; then
+ einfo "Elasticsearch started"
+ es_started=1
+ eend 0
+ break
+ elif grep -q 'BindException\[Address already in use\]' "${es_log}" 2>/dev/null; then
+ eend 1
+ eerror "Elasticsearch already running"
+ die "Cannot start Elasticsearch for tests"
+ else
+ einfo "Waiting for Elasticsearch"
+ sleep 2
+ continue
+ fi
+ done
+
+ [[ ${es_started} -eq 0 ]] && die "Elasticsearch failed to start"
+
+ distutils-r1_src_test
+
+ pkill -F ${pid} || die
+
+}
diff --git a/dev-python/elasticsearch-py/elasticsearch-py-8.6.2.ebuild b/dev-python/elasticsearch-py/elasticsearch-py-8.6.2.ebuild
new file mode 100644
index 000000000000..e70780772856
--- /dev/null
+++ b/dev-python/elasticsearch-py/elasticsearch-py-8.6.2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{9..11} )
+inherit distutils-r1
+
+DESCRIPTION="Official Elasticsearch client library for Python"
+HOMEPAGE="
+ https://ela.st/es-python
+ https://github.com/elastic/elasticsearch-py
+ https://pypi.org/project/elasticsearch/
+"
+# Use bundled jdk for the test elasticsearch as there is no convenient way to ensure system jdk17 is used
+SRC_URI="
+ https://github.com/elastic/elasticsearch-py/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
+ test? (
+ amd64? ( https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${PV}-linux-x86_64.tar.gz )
+ )
+"
+
+LICENSE="Apache-2.0"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~amd64 ~x86"
+
+RESTRICT="
+ !amd64? ( test )
+ !test? ( test )
+"
+
+RDEPEND="
+ >=dev-python/aiohttp-3[${PYTHON_USEDEP}] <dev-python/aiohttp-4[${PYTHON_USEDEP}]
+ >=dev-python/elastic-transport-8[${PYTHON_USEDEP}] <dev-python/elastic-transport-9[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.4[${PYTHON_USEDEP}] <dev-python/requests-3[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ ${RDEPEND}
+ dev-python/mapbox-vector-tile[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pandas[${PYTHON_USEDEP}]
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-5.4[${PYTHON_USEDEP}]
+ dev-python/unasync[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_IGNORE=(
+ # REST api tests are a black hole for effort. It downloads the tests so its an ever moving target
+ # It also requires effort to blacklist tests for apis which are license restricted.
+ "test_elasticsearch/test_server/test_rest_api_spec.py"
+ # Counting deprecation warnings from python is bound to fail even if all are fixed in this package
+ # Not worth it
+ "test_elasticsearch/test_client/test_deprecated_options.py"
+)
+
+distutils_enable_sphinx docs/sphinx dev-python/sphinx-rtd-theme
+distutils_enable_tests pytest
+
+src_prepare() {
+ # Replace added pytest options with setting asyncio_mode to auto.
+ # Test suite hasnt set asyncio parameters so its needed here.
+ sed -i '/[tool:pytest]/,/^$/ { s/addopts.*/asyncio_mode = auto/ }' setup.cfg || die
+
+ default
+}
+
+src_test() {
+ local es_port="25124"
+
+ export ES_DIR="${WORKDIR}/elasticsearch-${PV}"
+ export ES_INSTANCE="gentoo-es-py-test"
+ export ELASTIC_PASSWORD="changeme"
+ export ELASTICSEARCH_URL="https://elastic:${ELASTIC_PASSWORD}@localhost:${es_port}"
+
+ # Default behavior sets these depending on available memory.
+ # On my system its not reliable and leads to an instant OOM :D
+ # So lets add a reasonable limit
+ export ES_JAVA_OPTS="-Xmx4g"
+
+ cp -r "${S}/.ci/certs" "${ES_DIR}/config" || die
+
+ cat > "${ES_DIR}/config/elasticsearch.yml" <<-EOF || die
+ # Run elasticsearch on custom port
+ http.port: ${es_port}
+ cluster.routing.allocation.disk.threshold_enabled: false
+ bootstrap.memory_lock: true
+ node.attr.testattr: test
+ repositories.url.allowed_urls: http://snapshot.test*
+ action.destructive_requires_name: false
+ ingest.geoip.downloader.enabled: false
+
+ xpack.license.self_generated.type: basic
+ xpack.security.enabled: true
+ xpack.security.http.ssl.enabled: true
+ xpack.security.http.ssl.verification_mode: certificate
+ xpack.security.http.ssl.key: certs/testnode.key
+ xpack.security.http.ssl.certificate: certs/testnode.crt
+ xpack.security.http.ssl.certificate_authorities: certs/ca.crt
+ xpack.security.transport.ssl.enabled: true
+ xpack.security.transport.ssl.verification_mode: certificate
+ xpack.security.transport.ssl.key: certs/testnode.key
+ xpack.security.transport.ssl.certificate: certs/testnode.crt
+ xpack.security.transport.ssl.certificate_authorities: certs/ca.crt
+ EOF
+
+ # Set password in keystore
+ printf "y\n${ELASTIC_PASSWORD}\n" | ${ES_DIR}/bin/elasticsearch-keystore add "bootstrap.password" || die
+
+ local es_instance="gentoo-py-test"
+ local es_log="${ES_DIR}/logs/${es_instance}.log"
+ local es_temp="${T}/es_temp"
+ local pid="${ES_DIR}/elasticsearch.pid"
+
+ mkdir ${es_temp} || die
+
+ ebegin "Starting Elasticsearch for ${EPYTHON}"
+
+ # start local instance of elasticsearch
+ "${ES_DIR}"/bin/elasticsearch -d -p "${pid}" \
+ -Ecluster.name="${es_instance}" -Epath.repo="${es_temp}" || die
+
+ local i es_started=0
+ for i in {1..20}; do
+ grep -q "started" ${es_log} 2> /dev/null
+ if [[ $? -eq 0 ]]; then
+ einfo "Elasticsearch started"
+ es_started=1
+ eend 0
+ break
+ elif grep -q 'BindException\[Address already in use\]' "${es_log}" 2>/dev/null; then
+ eend 1
+ eerror "Elasticsearch already running"
+ die "Cannot start Elasticsearch for tests"
+ else
+ einfo "Waiting for Elasticsearch"
+ sleep 2
+ continue
+ fi
+ done
+
+ [[ ${es_started} -eq 0 ]] && die "Elasticsearch failed to start"
+
+ distutils-r1_src_test
+
+ pkill -F ${pid} || die
+}