nixpkgs/pkgs/development/python-modules/pytorch-lightning/default.nix
Peder Bergebakken Sundt ebc2389134 treewide: remove refs/tags/ from github release meta.changelog urls
diff of `jq <packages.json 'to_entries[]|"\(.key) \(.value.meta.changelog)"' -r`:

https://gist.github.com/pbsds/49b2e2ae5c9b967a0972bbc3c2597c12
2024-08-29 22:45:00 -04:00

76 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
fsspec,
lightning-utilities,
numpy,
packaging,
pyyaml,
tensorboardx,
torch,
torchmetrics,
tqdm,
traitlets,
# tests
psutil,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pytorch-lightning";
version = "2.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Lightning-AI";
repo = "pytorch-lightning";
rev = "refs/tags/${version}";
hash = "sha256-FngD3nYTGVEjS1VrXAVps2/B8VlS7BZMDAsmIDtAyW0=";
};
preConfigure = ''
export PACKAGE_NAME=pytorch
'';
build-system = [ setuptools ];
dependencies = [
fsspec
lightning-utilities
numpy
packaging
pyyaml
tensorboardx
torch
torchmetrics
tqdm
traitlets
] ++ fsspec.optional-dependencies.http;
nativeCheckInputs = [
psutil
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" ];
meta = {
description = "Lightweight PyTorch wrapper for machine learning researchers";
homepage = "https://github.com/Lightning-AI/pytorch-lightning";
changelog = "https://github.com/Lightning-AI/pytorch-lightning/releases/tag/${lib.removePrefix "refs/tags/" src.rev}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ tbenst ];
};
}