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