26 buildPythonPackage rec {
31 disabled = pythonOlder "3.7";
33 src = fetchFromGitHub {
36 rev = "refs/tags/${version}";
37 hash = "sha256-FZmLriYhsX+zyQKCtCjbOy6MH+AvjzHRNUyaDSXGlLI=";
42 name = "use-poetry-core.patch";
43 url = "https://github.com/poets-ai/elegy/commit/0ed472882f470ed9eb7a63b8a537ffabe7e19aa7.patch";
44 hash = "sha256-nO/imHo7tEsiZh+64CF/M4eXQ1so3IunVhv8CvYP1ks=";
48 # The cloudpickle constraint is too strict. wandb is marked as an optional
49 # dependency but `buildPythonPackage` doesn't seem to respect that setting.
50 # Python constraint: https://github.com/poets-ai/elegy/issues/244
52 substituteInPlace pyproject.toml \
53 --replace 'python = ">=3.7,<3.10"' 'python = ">=3.7"' \
54 --replace 'cloudpickle = "^1.5.0"' 'cloudpickle = "*"' \
55 --replace 'wandb = { version = "^0.12.10", optional = true }' ""
58 nativeBuildInputs = [ poetry-core ];
60 buildInputs = [ jaxlib ];
62 propagatedBuildInputs = [
76 pythonImportsCheck = [ "elegy" ];
86 # Fails with `Could not find compiler for platform Host: NOT_FOUND: could not find registered compiler for platform Host -- check target linkage`.
87 # Runs fine in docker with Ubuntu 22.04. I suspect the issue is the sandboxing in `nixpkgs` but not sure.
88 "test_saved_model_poly"
89 # AttributeError: module 'jax' has no attribute 'tree_multimap'
94 description = "Neural Networks framework based on Jax inspired by Keras and Haiku";
95 homepage = "https://github.com/poets-ai/elegy";
96 changelog = "https://github.com/poets-ai/elegy/releases/tag/${version}";
97 license = licenses.asl20;
98 maintainers = with maintainers; [ ndl ];