From 9ecd6c4c2d848254716a5ef91d9dde5eebb5df24 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 12 Jan 2023 18:45:26 +0100 Subject: [PATCH] python3Packages.pytorch-lightning: Fix build --- .../pytorch-lightning/default.nix | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/pytorch-lightning/default.nix b/pkgs/development/python-modules/pytorch-lightning/default.nix index 55e580308aa8..b5957968ba55 100644 --- a/pkgs/development/python-modules/pytorch-lightning/default.nix +++ b/pkgs/development/python-modules/pytorch-lightning/default.nix @@ -1,47 +1,65 @@ { lib , buildPythonPackage , fetchFromGitHub -, isPy27 -, future +, pythonOlder , fsspec +, lightning-utilities +, numpy , packaging -, pytestCheckHook -, torch , pyyaml -, tensorboard +, tensorboardx +, torch , torchmetrics -, tqdm }: +, tqdm +, traitlets + +# tests +, psutil +, pytestCheckHook +}: buildPythonPackage rec { pname = "pytorch-lightning"; version = "1.8.6"; - - disabled = isPy27; + format = "pyproject"; src = fetchFromGitHub { - owner = "PyTorchLightning"; - repo = pname; + owner = "Lightning-AI"; + repo = "pytorch-lightning"; rev = "refs/tags/${version}"; hash = "sha256-5AyOCeRFiV7rdmoBPx03Xju6eTR/3jiE+HQBiEmdzmo="; }; + preConfigure = '' + export PACKAGE_NAME=pytorch + ''; + propagatedBuildInputs = [ - packaging - future fsspec - torch + numpy + packaging pyyaml - tensorboard + tensorboardx + torch + lightning-utilities torchmetrics tqdm + traitlets + ] + ++ fsspec.optional-dependencies.http; + + checkInputs = [ + psutil + pytestCheckHook ]; - checkInputs = [ pytestCheckHook ]; # Some packages are not in NixPkgs; other tests try to build distributed # models, which doesn't work in the sandbox. doCheck = false; - pythonImportsCheck = [ "pytorch_lightning" ]; + pythonImportsCheck = [ + "pytorch_lightning" + ]; meta = with lib; { description = "Lightweight PyTorch wrapper for machine learning researchers";