nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 fsspec,
11 lightning-utilities,
12 numpy,
13 packaging,
14 pyyaml,
15 torch,
16 torchmetrics,
17 tqdm,
18 traitlets,
19
20 # tests
21 psutil,
22 pytestCheckHook,
23}:
24
25buildPythonPackage (finalAttrs: {
26 pname = "pytorch-lightning";
27 version = "2.6.1";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "Lightning-AI";
32 repo = "pytorch-lightning";
33 tag = finalAttrs.version;
34 hash = "sha256-zOSV2X3yZy0uh1lJ2yNl/hHBvfIDcIrATHtiRwThsQA=";
35 };
36
37 env.PACKAGE_NAME = "pytorch";
38
39 build-system = [ setuptools ];
40
41 dependencies = [
42 fsspec
43 lightning-utilities
44 numpy
45 packaging
46 pyyaml
47 torch
48 torchmetrics
49 tqdm
50 traitlets
51 ]
52 ++ fsspec.optional-dependencies.http;
53
54 nativeCheckInputs = [
55 psutil
56 pytestCheckHook
57 ];
58
59 # Some packages are not in NixPkgs; other tests try to build distributed
60 # models, which doesn't work in the sandbox.
61 doCheck = false;
62
63 pythonImportsCheck = [ "pytorch_lightning" ];
64
65 meta = {
66 description = "Lightweight PyTorch wrapper for machine learning researchers";
67 homepage = "https://github.com/Lightning-AI/pytorch-lightning";
68 changelog = "https://github.com/Lightning-AI/pytorch-lightning/releases/tag/${finalAttrs.src.tag}";
69 license = lib.licenses.asl20;
70 maintainers = [ ];
71 };
72})