1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 numpy,
6 scipy,
7 pytest,
8 python,
9 pybind11,
10 setuptools-scm,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "pyamg";
16 version = "5.2.1";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-9EnZNCJOUDQB7nLNLuzhop2JO3q+NfYqRNUrqDEZjvo=";
24 };
25
26 nativeBuildInputs = [ setuptools-scm ];
27
28 propagatedBuildInputs = [
29 numpy
30 scipy
31 pytest
32 pybind11
33 ];
34
35 checkPhase = ''
36 runHook preCheck
37
38 # The `pyamg` directory in PWD doesn't have the compiled Cython modules in it, but has higher import priority compared to the properly built and installed `pyamg`.
39 # It's easier to just remove the package directory in PWD.
40 rm -r pyamg
41 ${python.interpreter} -c "import pyamg; pyamg.test()"
42
43 runHook postCheck
44 '';
45
46 pythonImportsCheck = [
47 "pyamg"
48 "pyamg.amg_core.evolution_strength"
49 ];
50
51 meta = with lib; {
52 description = "Algebraic Multigrid Solvers in Python";
53 homepage = "https://github.com/pyamg/pyamg";
54 changelog = "https://github.com/pyamg/pyamg/blob/v${version}/changelog.md";
55 license = licenses.mit;
56 maintainers = [ ];
57 };
58}