2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-09-09 14:08:57 +00:00
|
|
|
, setuptools-scm
|
2022-08-12 12:06:08 +00:00
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
|
|
|
, numpy
|
|
|
|
, numba
|
|
|
|
, typing-extensions
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "galois";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.3.3";
|
2022-09-09 14:08:57 +00:00
|
|
|
format = "pyproject";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mhostetter";
|
|
|
|
repo = "galois";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-nlNy4+GwStyuCD8f47w07NhNmepxBRtu6PXiL31vzwA=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
numba
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "numpy >= 1.18.4, < 1.24" "numpy >= 1.18.4" \
|
|
|
|
--replace "numba >= 0.53, < 0.57" "numba >= 0.53" \
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "galois" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A Python 3 package that extends NumPy arrays to operate over finite fields";
|
|
|
|
homepage = "https://github.com/mhostetter/galois";
|
|
|
|
downloadPage = "https://github.com/mhostetter/galois/releases";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ chrispattison ];
|
|
|
|
};
|
|
|
|
}
|