evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / compressai / default.nix
blob66fa915ebef604079c5addb093ae0e1e854f2f71
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
6   # build-system
7   pybind11,
8   setuptools,
10   # dependencies
11   einops,
12   numpy,
13   matplotlib,
14   pandas,
15   pytorch-msssim,
16   scipy,
17   torch,
18   torch-geometric,
19   torchvision,
21   # optional-dependencies
22   ipywidgets,
23   jupyter,
25   # tests
26   plotly,
27   pytestCheckHook,
30 buildPythonPackage rec {
31   pname = "compressai";
32   version = "1.2.6";
33   pyproject = true;
35   src = fetchFromGitHub {
36     owner = "InterDigitalInc";
37     repo = "CompressAI";
38     rev = "refs/tags/v${version}";
39     hash = "sha256-xvzhhLn0iBzq3h1nro8/83QWEQe9K4zRa3RSZk+hy3Y=";
40     fetchSubmodules = true;
41   };
43   build-system = [
44     pybind11
45     setuptools
46   ];
48   dependencies = [
49     einops
50     numpy
51     matplotlib
52     pandas
53     pytorch-msssim
54     scipy
55     torch
56     torch-geometric
57     torchvision
58   ];
60   optional-dependencies = {
61     tutorials = [
62       ipywidgets
63       jupyter
64     ];
65   };
67   pythonImportsCheck = [
68     "compressai"
69     "compressai._CXX"
70   ];
72   preCheck = ''
73     # We have to delete the source because otherwise it is used intead the installed package.
74     rm -rf compressai
76     export HOME=$(mktemp -d)
77   '';
79   nativeCheckInputs = [
80     plotly
81     pytestCheckHook
82   ];
84   disabledTests = [
85     # Those tests require internet access to download some weights
86     "test_image_codec"
87     "test_update"
88     "test_eval_model_pretrained"
89     "test_cheng2020_anchor"
90     "test_pretrained"
91   ];
93   meta = {
94     description = "PyTorch library and evaluation platform for end-to-end compression research";
95     homepage = "https://github.com/InterDigitalInc/CompressAI";
96     license = lib.licenses.bsd3Clear;
97     maintainers = with lib.maintainers; [ GaetanLepage ];
98   };