1{ lib
2, buildPythonPackage
3, fetchPypi
4, cython
5, jinja2
6, numpy
7, pyparsing
8, setuptools
9, sympy
10, pytest
11, pytest-xdist
12, python
13}:
14
15buildPythonPackage rec {
16 pname = "brian2";
17 version = "2.5.4";
18
19 src = fetchPypi {
20 pname = "Brian2";
21 inherit version;
22 hash = "sha256-XMXSOwcH8fLgzXCcT+grjYxhBdtF4H/Vr+S7J4GYZSw=";
23 };
24
25 propagatedBuildInputs = [
26 cython
27 jinja2
28 numpy
29 pyparsing
30 setuptools
31 sympy
32 ];
33
34 checkInputs = [
35 pytest
36 pytest-xdist
37 ];
38
39 checkPhase = ''
40 runHook preCheck
41 # Cython cache lies in home directory
42 export HOME=$(mktemp -d)
43 cd $HOME && ${python.interpreter} -c "import brian2;assert brian2.test()"
44 runHook postCheck
45 '';
46
47 meta = with lib; {
48 description = "A clock-driven simulator for spiking neural networks";
49 homepage = "https://briansimulator.org/";
50 license = licenses.cecill21;
51 maintainers = with maintainers; [ jiegec ];
52 };
53}