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 albucore,
11 numpy,
12 opencv-python,
13 pydantic,
14 pyyaml,
15 scipy,
16
17 # optional dependencies
18 huggingface-hub,
19 pillow,
20 torch,
21
22 # tests
23 deepdiff,
24 pytestCheckHook,
25 pytest-mock,
26 scikit-image,
27 scikit-learn,
28 torchvision,
29}:
30
31buildPythonPackage rec {
32 pname = "albumentations";
33 version = "2.0.8";
34 pyproject = true;
35
36 src = fetchFromGitHub {
37 owner = "albumentations-team";
38 repo = "albumentations";
39 tag = version;
40 hash = "sha256-8vUipdkIelRtKwMw63oUBDN/GUI0gegMGQaqDyXAOTQ=";
41 };
42
43 patches = [
44 ./dont-check-for-updates.patch
45 ];
46
47 pythonRelaxDeps = [ "opencv-python" ];
48
49 build-system = [ setuptools ];
50
51 dependencies = [
52 albucore
53 numpy
54 opencv-python
55 pydantic
56 pyyaml
57 scipy
58 ];
59
60 optional-dependencies = {
61 hub = [ huggingface-hub ];
62 pytorch = [ torch ];
63 text = [ pillow ];
64 };
65
66 nativeCheckInputs = [
67 deepdiff
68 pytestCheckHook
69 pytest-mock
70 scikit-image
71 scikit-learn
72 torch
73 torchvision
74 ];
75
76 disabledTests = [
77 "test_pca_inverse_transform"
78 # these tests hang
79 "test_keypoint_remap_methods"
80 "test_multiprocessing_support"
81 ];
82
83 pythonImportsCheck = [ "albumentations" ];
84
85 meta = {
86 description = "Fast image augmentation library and easy to use wrapper around other libraries";
87 homepage = "https://github.com/albumentations-team/albumentations";
88 changelog = "https://github.com/albumentations-team/albumentations/releases/tag/${src.tag}";
89 license = lib.licenses.mit;
90 maintainers = with lib.maintainers; [ natsukium ];
91 };
92}