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.7.0";
19 pyproject = true;
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-d9GDWp8CGIjeprWf4TtchVd36gmo36HBRkBOLaRXbpo=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [
29 cython
30 jinja2
31 numpy
32 pyparsing
33 setuptools
34 sympy
35 ];
36
37 nativeCheckInputs = [
38 pytest
39 pytest-xdist
40 ];
41
42 checkPhase = ''
43 runHook preCheck
44 # Cython cache lies in home directory
45 export HOME=$(mktemp -d)
46 cd $HOME && ${python.interpreter} -c "import brian2;assert brian2.test()"
47 runHook postCheck
48 '';
49
50 meta = with lib; {
51 description = "Clock-driven simulator for spiking neural networks";
52 homepage = "https://briansimulator.org/";
53 license = licenses.cecill21;
54 maintainers = with maintainers; [ jiegec ];
55 };
56}