nixpkgs/pkgs/development/python-modules/brian2/default.nix
Martin Weinelt 1ce86e9481 python3Packages.brian2: 2.9.0 -> 2.10.1
This commit was automatically generated using update-python-libraries.
2026-02-01 16:42:23 +01:00

77 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
cython,
jinja2,
numpy,
pyparsing,
setuptools,
sympy,
pytest,
pythonOlder,
pytest-xdist,
setuptools-scm,
python,
scipy,
}:
buildPythonPackage rec {
pname = "brian2";
version = "2.10.1";
pyproject = true;
# https://github.com/python/cpython/issues/117692
disabled = pythonOlder "3.12";
src = fetchPypi {
inherit pname version;
hash = "sha256-wdIdewkhkjYkGddvyHH+q5/wuz0A6SZdjNQIbMLhG08=";
};
patches = [
./0001-remove-invalidxyz.patch # invalidxyz are reported as error so I remove it
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "numpy>=2.0.0rc1" "numpy"
substituteInPlace brian2/codegen/cpp_prefs.py \
--replace-fail "distutils" "setuptools._distutils"
'';
build-system = [
setuptools-scm
];
dependencies = [
cython
jinja2
numpy
pyparsing
setuptools
sympy
scipy
];
nativeCheckInputs = [
pytest
pytest-xdist
];
checkPhase = ''
runHook preCheck
# Cython cache lies in home directory
export HOME=$(mktemp -d)
cd $HOME && ${python.interpreter} -c "import brian2;assert brian2.test()"
runHook postCheck
'';
meta = {
description = "Clock-driven simulator for spiking neural networks";
homepage = "https://briansimulator.org/";
license = lib.licenses.cecill21;
maintainers = with lib.maintainers; [ jiegec ];
};
}