Files
nixpkgs/pkgs/development/python-modules/ndindex/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

84 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
python,
# build-system
cython,
setuptools,
# optional
numpy,
# tests
hypothesis,
pytest-cov-stub,
pytestCheckHook,
sympy,
}:
buildPythonPackage rec {
pname = "ndindex";
version = "1.10.1";
pyproject = true;
src = fetchFromGitHub {
owner = "Quansight-Labs";
repo = "ndindex";
tag = version;
hash = "sha256-rjhCysdhLCAofob7yUL7s65hMju13uotrzJ+aY0stzI=";
};
build-system = [
cython
setuptools
];
postPatch = ''
substituteInPlace pytest.ini \
--replace-fail "--flakes" ""
'';
optional-dependencies.arrays = [ numpy ];
pythonImportsCheck = [ "ndindex" ];
# fix Hypothesis timeouts
preCheck = ''
cd $out
echo > ${python.sitePackages}/ndindex/tests/conftest.py <<EOF
import hypothesis
hypothesis.settings.register_profile(
"ci",
deadline=None,
print_blob=True,
derandomize=True,
)
EOF
'';
nativeCheckInputs = [
hypothesis
pytest-cov-stub
pytestCheckHook
sympy
]
++ optional-dependencies.arrays;
pytestFlags = [
"--hypothesis-profile=ci"
];
meta = {
description = "Python library for manipulating indices of ndarrays";
homepage = "https://github.com/Quansight-Labs/ndindex";
changelog = "https://github.com/Quansight-Labs/ndindex/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = [ ];
};
}