Files
nixpkgs/pkgs/development/python-modules/equinox/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

75 lines
1.6 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
hatchling,
# dependencies
jax,
jaxtyping,
typing-extensions,
wadler-lindig,
# tests
beartype,
optax,
pytest-xdist,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "equinox";
version = "0.13.1";
pyproject = true;
src = fetchFromGitHub {
owner = "patrick-kidger";
repo = "equinox";
tag = "v${version}";
hash = "sha256-txgL5a+kKT28gAS8HianBgnnR+J25R2wrpRr8HEWCXA=";
};
# Relax speed constraints on tests that can fail on busy builders
postPatch = ''
substituteInPlace tests/test_while_loop.py \
--replace-fail "speed < 0.1" "speed < 0.5" \
--replace-fail "speed < 0.5" "speed < 1" \
--replace-fail "speed < 1" "speed < 20" \
--replace-fail "speed < 2" "speed < 20"
'';
build-system = [ hatchling ];
dependencies = [
jax
jaxtyping
typing-extensions
wadler-lindig
];
nativeCheckInputs = [
beartype
optax
pytest-xdist
pytestCheckHook
];
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated!
"test_filter"
];
pythonImportsCheck = [ "equinox" ];
meta = {
description = "JAX library based around a simple idea: represent parameterised functions (such as neural networks) as PyTrees";
changelog = "https://github.com/patrick-kidger/equinox/releases/tag/v${version}";
homepage = "https://github.com/patrick-kidger/equinox";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}