about summary refs log tree commit diff
path: root/pkgs/by-name/ic/icloudpd/package.nix
blob: 01f30919e27306dd7c5d08498b46d1cb9b2d4ce2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{ lib
, python3Packages
, fetchFromGitHub
, nix-update-script
, testers
, icloudpd
}:

python3Packages.buildPythonApplication rec {
  pname = "icloudpd";
  version = "1.17.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "icloud-photos-downloader";
    repo = "icloud_photos_downloader";
    rev = "v${version}";
    hash = "sha256-xsUayewn6c+TFqQnvDWe+1y4o76Quq8sK1WkSFFgPkc=";
  };

  pythonRelaxDeps = true;

  nativeBuildInputs = with python3Packages; [
    pythonRelaxDepsHook
  ];

  propagatedBuildInputs = with python3Packages; [
    wheel
    setuptools
    requests
    schema
    click
    python-dateutil
    tqdm
    piexif
    urllib3
    six
    tzlocal
    pytz
    certifi
    keyring
    keyrings-alt
  ];

  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
    mock
    freezegun
    vcrpy
    pytest-timeout
  ];

  disabledTests = [
    # touches network
    "test_autodelete_photos"
    "test_download_autodelete_photos"
    "test_retry_delete_after_download_session_error"
    "test_retry_fail_delete_after_download_session_error"
    "test_retry_delete_after_download_internal_error"
    "test_autodelete_photos_dry_run"
    "test_retry_fail_delete_after_download_internal_error"
    "test_autodelete_invalid_creation_date"
  ];

  passthru = {
    updateScript = nix-update-script { };
    tests = testers.testVersion { package = icloudpd; };
  };

  preBuild = ''
    substituteInPlace pyproject.toml \
      --replace "setuptools==69.0.2" "setuptools" \
      --replace "wheel==0.42.0" "wheel"
  '';

  meta = with lib; {
    homepage = "https://github.com/icloud-photos-downloader/icloud_photos_downloader";
    description = "iCloud Photos Downloader";
    license = licenses.mit;
    mainProgram = "icloudpd";
    maintainers = with maintainers; [ anpin Enzime ];
  };
}