python3Packages.array-api-compat: init at 1.8

This commit is contained in:
Eric Berquist 2024-08-04 15:36:29 -04:00
parent f02fa2f654
commit e6fe536a0c
No known key found for this signature in database
GPG Key ID: BAFD205D5FA2B329
2 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,63 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
setuptools,
numpy,
jaxlib,
jax,
torch,
dask,
sparse,
array-api-strict,
config,
cudaSupport ? config.cudaSupport,
cupy,
nix-update-script,
}:
buildPythonPackage rec {
pname = "array-api-compat";
version = "1.8";
pyproject = true;
src = fetchFromGitHub {
owner = "data-apis";
repo = "array-api-compat";
rev = "refs/tags/${version}";
hash = "sha256-DZs51yWgeMX7lmzR6jily0S3MRD4AVlk7BP8aU99Zp8=";
};
build-system = [ setuptools ];
nativeCheckInputs = [
pytestCheckHook
numpy
jaxlib
jax
torch
dask
sparse
array-api-strict
] ++ lib.optionals cudaSupport [ cupy ];
pythonImportsCheck = [ "array_api_compat" ];
# CUDA (used via cupy) is not available in the testing sandbox
checkPhase = ''
runHook preCheck
python -m pytest -k 'not cupy'
runHook postCheck
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://data-apis.org/array-api-compat";
changelog = "https://github.com/data-apis/array-api-compat/releases/tag/${version}";
description = "Compatibility layer for NumPy to support the Python array API";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ berquist ];
};
}

View File

@ -779,6 +779,8 @@ self: super: with self; {
arnparse = callPackage ../development/python-modules/arnparse { };
array-api-compat = callPackage ../development/python-modules/array-api-compat { };
array-api-strict = callPackage ../development/python-modules/array-api-strict { };
array-record = callPackage ../development/python-modules/array-record { };