1{ lib
2, buildPythonPackage
3, setuptools-scm
4, pythonOlder
5, fetchFromGitHub
6, pytestCheckHook
7, pytest-xdist
8, numpy
9, numba
10, typing-extensions
11}:
12
13buildPythonPackage rec {
14 pname = "galois";
15 version = "0.1.1";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "mhostetter";
22 repo = "galois";
23 rev = "refs/tags/v${version}";
24 sha256 = "sha256-ekbebwsdGkINdOFI+LLdwTRBN6d8mlNmftkj5SNRKNI=";
25 };
26
27 SETUPTOOLS_SCM_PRETEND_VERSION = version;
28
29 nativeBuildInputs = [
30 setuptools-scm
31 ];
32
33 propagatedBuildInputs = [
34 numpy
35 numba
36 typing-extensions
37 ];
38
39 checkInputs = [
40 pytestCheckHook
41 pytest-xdist
42 ];
43
44 postPatch = ''
45 substituteInPlace pyproject.toml \
46 --replace "numpy >= 1.18.4, < 1.24" "numpy >= 1.18.4" \
47 --replace "numba >= 0.53, < 0.57" "numba >= 0.53" \
48 '';
49
50 pythonImportsCheck = [ "galois" ];
51
52 meta = {
53 description = "A Python 3 package that extends NumPy arrays to operate over finite fields";
54 homepage = "https://github.com/mhostetter/galois";
55 downloadPage = "https://github.com/mhostetter/galois/releases";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ chrispattison ];
58 };
59}