diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-04-03 05:19:36 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-04-03 05:19:36 +0100 |
commit | 155cc74ccaea367efa88c8acfadcf25cb7dfe89c (patch) | |
tree | 7c071f2c978804bd5ad135f096c2c1849d338b6f /dev-python/pytables | |
parent | d288197c01703f58dbea0ff4f42b01e7c4c6f327 (diff) |
gentoo auto-resync : 03:04:2023 - 05:19:36
Diffstat (limited to 'dev-python/pytables')
-rw-r--r-- | dev-python/pytables/Manifest | 4 | ||||
-rw-r--r-- | dev-python/pytables/files/pytables-3.8.0-optional-cpuinfo.patch | 69 | ||||
-rw-r--r-- | dev-python/pytables/metadata.xml | 3 | ||||
-rw-r--r-- | dev-python/pytables/pytables-3.8.0-r3.ebuild | 82 |
4 files changed, 157 insertions, 1 deletions
diff --git a/dev-python/pytables/Manifest b/dev-python/pytables/Manifest index 342f564c1d1c..da7ceb125598 100644 --- a/dev-python/pytables/Manifest +++ b/dev-python/pytables/Manifest @@ -1,6 +1,8 @@ AUX pytables-3.8.0-blosc2.patch 842 BLAKE2B 1ab97a9b0d5c5e435671c00cb8d5ab77048f9eea493a716846e7d350f902487c2098d43d194c5373ca4297f0d266b723a3d9eb59f69836278adfbb4a75c22820 SHA512 b64944a0916b7da5543b518e16fc70ead6b2f7c0bfdb79bf0e49549067464997b9906bb2b1d0d02b32abbe315135c09e64ffec91fc57b8f87117c33564684b25 +AUX pytables-3.8.0-optional-cpuinfo.patch 3185 BLAKE2B 1e5afa906c427408a81b477f4d6aa09ee903d73db3cee048464b277a69ee0f96cdc23ca660d4eb68b49ae4d88386711e5340cb4deae4632a8af0512ca5b64437 SHA512 3f9da3a9f2a95d80b2af458744a369a45725aa72fa64a316f6e281695e710aadf0d785cc80fd25639a032a9b3bf04a3f06c73c21b1812656251e8ebdaf842032 DIST tables-3.7.0.tar.gz 8227955 BLAKE2B 0d5b7b765375c4787f1210138e5fd02e3c0ce429ef209a3a8d4fd3bc094f68486ab6f4d0a960ce86efea6991ed691ef2a3e9e8f37a49fe91cb8d6372cadea80e SHA512 eaa368d063b5fad87e6d0f9ab6f02da0b2a3542740a52fe8c2bb58e41121495d07b6d2710ad402a28891294aa61a11238c6a7e2cf2933a1bb11391b79cf4fd13 DIST tables-3.8.0.tar.gz 8014052 BLAKE2B 28d120ad609ebc9ae8cd97286bb3fb9c484bd8a179edcf0de1b96e4400b7a21b4db835d94fae3aaee84924bd46b84b84da12c538b39517362d805651e7aa3aef SHA512 1616c00787a2e88ff3dc2aebe3a1b2ad428b5a8ea48fc94058b49c509f1c040b540b3f62551b16b3246d2fed58e0b33443cbdaaf1dfcba5a6eead5f3e8028029 EBUILD pytables-3.7.0.ebuild 1645 BLAKE2B b8e46514aad26f9f76d120700e0cd2633dffec035b04205fd3d6f01264902608fae5a09a53d323b55fa6d039d16aaf1b7cd5f970aa7da53c72b3358219be2cdf SHA512 6b70999d5972c851b7dcf77ba1b6966c0d35638524d3fda1a83b1ff1d6cccdb56ffcb48930121e331919ff442289fbf9f3b52fa94146f4cab9d5994c1a987899 EBUILD pytables-3.8.0-r1.ebuild 1670 BLAKE2B 2ae2fa481476cbf77389a33aa1acaa4c05040a1567264f481dc4a1dc97e95b966f076e4b0e03fd8a341cbe85fa77ff6201709d1b8bb68c70fea62cd25db54015 SHA512 9d3d9ab8c322165ce5b81d91d55fccc3ea4526df592d5a1c9afaa7ed9f5a9c8fb11785f44b33a8c60f740015087b6a4e9c7a5cf95a8b22234737ce28a995c111 -MISC metadata.xml 956 BLAKE2B 83bc2b1782cf984d8fda896db3662b926addd243421e95e8c028c2ae179686b0d3ec9520aa5f83109944b110750b764daed9f20435270779f9f738c172b2d911 SHA512 4106148d9f0512a07aa08e55cfa979d3b36c59ef1cd2b45b0cef3d3e13bf4bb36c5436da055f3dddb7f8c2b726f87f637613f05e63df08019fc3eba3cf3134ac +EBUILD pytables-3.8.0-r3.ebuild 1824 BLAKE2B 45fb118be68032a2900e152dd4ec2f35c23ee8855feb63e2e52b687dcad0e55c10ffde9874afb7654b7b72e41b25c927475a4d73344b60b42ecf9d23117f7eb4 SHA512 2be2a747031d56070de02cb9571c9c41ca302a33de94b65060c1c7ed98c0ea82ced0abff5f612875c8f34176e31db4695ca6d87791018880f07318d64b4be560 +MISC metadata.xml 1090 BLAKE2B cc213079beb7f2888b5eab4886711fe8a4b7a4bc3cf13ff4d2247bd04edc05fdaed19c464ae28beac27de511ea997bcc873866bf9d544d6efe8cacd095e8640a SHA512 bd322eade443a3b1b610d262a0a6a30088246b3f772624fdfbf6eac85f240deb3f9001be1e2e20e334e65701c24e1d57100c67864d14067b1ae16e99f2136e8a diff --git a/dev-python/pytables/files/pytables-3.8.0-optional-cpuinfo.patch b/dev-python/pytables/files/pytables-3.8.0-optional-cpuinfo.patch new file mode 100644 index 000000000000..2843914f4a87 --- /dev/null +++ b/dev-python/pytables/files/pytables-3.8.0-optional-cpuinfo.patch @@ -0,0 +1,69 @@ +https://github.com/PyTables/PyTables/pull/1013 + +From 9d2487eb53af940de3b5c79200c9f4c2b90f51f2 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Mon, 3 Apr 2023 02:07:47 +0100 +Subject: [PATCH] Handle py-cpuinfo not being installed + +Fallback gracefully if py-cpuinfo isn't installed. We already handle this in +setup.py but we need to avoid calling it in leaf.py too. + +py-cpuinfo isn't available on all platforms and PyTables is needed to run +the test suite for some software, so we need to be able to run PyTables +in places where py-cpuinfo isn't yet ported. + +Signed-off-by: Sam James <sam@gentoo.org> +--- a/tables/leaf.py ++++ b/tables/leaf.py +@@ -4,7 +4,11 @@ import warnings + import math + + import numpy as np +-import cpuinfo ++try: ++ import cpuinfo ++ missing_cpuinfo = False ++except ImportError: ++ missing_cpuinfo = True + + from .flavor import (check_flavor, internal_flavor, toarray, + alias_map as flavor_alias_map) +@@ -336,20 +340,21 @@ class Leaf(Node): + # Use a decent default value for chunksize + chunksize *= 16 + # Now, go explore the L3 size and try to find a smarter chunksize +- cpu_info = cpuinfo.get_cpu_info() +- if 'l3_cache_size' in cpu_info: +- # In general, is a good idea to set the chunksize equal to L3 +- l3_cache_size = cpu_info['l3_cache_size'] +- # cpuinfo sometimes returns cache sizes as strings (like, +- # "4096 KB"), so refuse the temptation to guess and use the +- # value only when it is an actual int. +- # Also, sometimes cpuinfo does not return a correct L3 size; +- # so in general, enforcing L3 > L2 is a good sanity check. +- l2_cache_size = cpu_info.get('l2_cache_size', "Not found") +- if (type(l3_cache_size) is int and +- type(l2_cache_size) is int and +- l3_cache_size > l2_cache_size): +- chunksize = l3_cache_size ++ if not missing_cpuinfo: ++ cpu_info = cpuinfo.get_cpu_info() ++ if 'l3_cache_size' in cpu_info: ++ # In general, is a good idea to set the chunksize equal to L3 ++ l3_cache_size = cpu_info['l3_cache_size'] ++ # cpuinfo sometimes returns cache sizes as strings (like, ++ # "4096 KB"), so refuse the temptation to guess and use the ++ # value only when it is an actual int. ++ # Also, sometimes cpuinfo does not return a correct L3 size; ++ # so in general, enforcing L3 > L2 is a good sanity check. ++ l2_cache_size = cpu_info.get('l2_cache_size', "Not found") ++ if (type(l3_cache_size) is int and ++ type(l2_cache_size) is int and ++ l3_cache_size > l2_cache_size): ++ chunksize = l3_cache_size + # In Blosc2, the chunksize cannot be larger than 2 GB - BLOSC2_MAX_BUFFERSIZE + if chunksize > 2**31 - 32: + chunksize = 2**31 - 32 +-- +2.40.0 + diff --git a/dev-python/pytables/metadata.xml b/dev-python/pytables/metadata.xml index 75a6770d99e4..2fea045e5982 100644 --- a/dev-python/pytables/metadata.xml +++ b/dev-python/pytables/metadata.xml @@ -17,6 +17,9 @@ from Pyrex sources, makes it a fast, yet extremely easy to use tool for interactively save and retrieve large amounts of data. </longdescription> + <use> + <flag name="cpudetection">Enables runtime CPU detection (useful for bindist, compatibility on other CPUs)</flag> + </use> <upstream> <remote-id type="github">PyTables/PyTables</remote-id> <remote-id type="pypi">tables</remote-id> diff --git a/dev-python/pytables/pytables-3.8.0-r3.ebuild b/dev-python/pytables/pytables-3.8.0-r3.ebuild new file mode 100644 index 000000000000..1e479c6bc7d4 --- /dev/null +++ b/dev-python/pytables/pytables-3.8.0-r3.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) +PYPI_PN="tables" +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 prefix pypi + +DESCRIPTION="Hierarchical datasets for Python" +HOMEPAGE=" + https://www.pytables.org/ + https://github.com/PyTables/PyTables/ + https://pypi.org/project/tables/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="+cpudetection examples test" +RESTRICT="!test? ( test )" + +DEPEND=" + app-arch/bzip2:0= + app-arch/lz4:0= + >=app-arch/zstd-1.0.0:= + >=dev-libs/c-blosc-1.11.1:0= + dev-libs/c-blosc2:= + dev-libs/lzo:2= + >=dev-python/numpy-1.19[${PYTHON_USEDEP}] + >=sci-libs/hdf5-1.8.4:= +" +RDEPEND=" + ${DEPEND} + >=dev-python/numexpr-2.6.2[${PYTHON_USEDEP}] + dev-python/packaging[${PYTHON_USEDEP}] + cpudetection? ( dev-python/py-cpuinfo[${PYTHON_USEDEP}] ) +" +BDEPEND=" + >=dev-python/cython-0.21[${PYTHON_USEDEP}] + virtual/pkgconfig + cpudetection? ( dev-python/py-cpuinfo[${PYTHON_USEDEP}] ) + test? ( + ${RDEPEND} + ) +" + +python_prepare_all() { + local PATCHES=( + "${FILESDIR}"/${P}-blosc2.patch + "${FILESDIR}"/${P}-optional-cpuinfo.patch + ) + + export PYTABLES_NO_EMBEDDED_LIBS=1 + export USE_PKGCONFIG=TRUE + + rm -r c-blosc/{blosc,internal-complibs} || die + rm tables/libblosc2.so || die + sed -i -e '/blosc2/d' requirements.txt || die + hprefixify -w '/prefixes =/' setup.py + distutils-r1_python_prepare_all +} + +python_compile() { + distutils-r1_python_compile -j1 +} + +python_test() { + cd "${BUILD_DIR}"/lib* || die + "${EPYTHON}" tables/tests/test_all.py -v || die +} + +python_install_all() { + distutils-r1_python_install_all + + if use examples; then + dodoc -r contrib examples + docompress -x /usr/share/doc/${PF}/{contrib,examples} + fi +} |