2024-06-05 15:53:02 +00:00
{
lib ,
stdenv ,
buildPythonPackage ,
fetchpatch ,
fetchPypi ,
setuptools ,
setuptools-scm ,
cython ,
numpy ,
msgpack ,
py-cpuinfo ,
pytestCheckHook ,
python ,
pythonOlder ,
2020-04-24 23:36:52 +00:00
} :
buildPythonPackage rec {
pname = " n u m c o d e c s " ;
2024-01-13 08:15:51 +00:00
version = " 0 . 1 2 . 1 " ;
pyproject = true ;
disabled = pythonOlder " 3 . 8 " ;
2020-04-24 23:36:52 +00:00
src = fetchPypi {
inherit pname version ;
2024-01-13 08:15:51 +00:00
hash = " s h a 2 5 6 - B d k a Q z c z 5 + 7 y a N f o D s I m o C M t o k Q o l h S o 8 4 J p A a 7 B C Y 4 = " ;
2020-04-24 23:36:52 +00:00
} ;
2024-01-13 08:15:51 +00:00
patches = [
# https://github.com/zarr-developers/numcodecs/pull/487
( fetchpatch {
name = " f i x - t e s t s . p a t c h " ;
url = " h t t p s : / / g i t h u b . c o m / z a r r - d e v e l o p e r s / n u m c o d e c s / c o m m i t / 4 8 9 6 6 8 0 0 8 7 d 3 f f 1 f 9 5 9 4 0 1 c 5 1 c f 5 a e a 0 f d 5 6 5 5 4 e . p a t c h " ;
hash = " s h a 2 5 6 - + l M W K 5 I s N z J 7 H 2 S m L c k g x b S S R I I c C 7 F t G Y S B K Q t u o + Y = " ;
} )
] ;
2020-04-24 23:36:52 +00:00
nativeBuildInputs = [
2023-01-20 10:41:00 +00:00
setuptools
2021-06-04 09:07:49 +00:00
setuptools-scm
2020-04-24 23:36:52 +00:00
cython
2023-01-20 10:41:00 +00:00
py-cpuinfo
2020-04-24 23:36:52 +00:00
] ;
2024-06-05 15:53:02 +00:00
propagatedBuildInputs = [ numpy ] ;
2020-04-24 23:36:52 +00:00
2024-10-04 16:56:33 +00:00
optional-dependencies = {
2024-01-13 08:15:51 +00:00
msgpack = [ msgpack ] ;
# zfpy = [ zfpy ];
} ;
2024-06-05 15:53:02 +00:00
preBuild =
if ( stdenv . hostPlatform . isx86 && ! stdenv . hostPlatform . avx2Support ) then
''
export DISABLE_NUMCODECS_AVX2 =
''
else
null ;
2023-07-15 17:15:38 +00:00
2023-02-02 18:25:31 +00:00
nativeCheckInputs = [
2020-08-20 17:08:02 +00:00
pytestCheckHook
2024-01-13 08:15:51 +00:00
msgpack
2020-04-24 23:36:52 +00:00
] ;
2024-06-05 15:53:02 +00:00
pytestFlagsArray = [ " $ o u t / ${ python . sitePackages } / n u m c o d e c s " ] ;
2020-08-20 17:08:02 +00:00
disabledTests = [
" t e s t _ b a c k w a r d s _ c o m p a t i b i l i t y "
" t e s t _ e n c o d e _ d e c o d e "
" t e s t _ l e g a c y _ c o d e c _ b r o k e n "
" t e s t _ b y t e s "
2023-03-15 16:39:30 +00:00
# ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
# with numpy 1.24
" t e s t _ n o n _ n u m p y _ i n p u t s "
2020-08-20 17:08:02 +00:00
] ;
2020-04-24 23:36:52 +00:00
2024-06-05 15:53:02 +00:00
meta = with lib ; {
2021-09-18 10:52:07 +00:00
homepage = " h t t p s : / / g i t h u b . c o m / z a r r - d e v e l o p e r s / n u m c o d e c s " ;
2020-04-24 23:36:52 +00:00
license = licenses . mit ;
description = " B u f f e r c o m p r e s s i o n a n d t r a n s f o r m a t i o n c o d e c s f o r u s e i n d a t a s t o r a g e a n d c o m m u n i c a t i o n a p p l i c a t i o n s " ;
2023-08-04 22:07:22 +00:00
maintainers = [ ] ;
2020-04-24 23:36:52 +00:00
} ;
}