summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/withings-sync/default.nix
blob: 210033536aeb86d5fd7f4a80795d78b93ca70227 (plain)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  garth,
  importlib-resources,
  lxml,
  poetry-core,
  python-dotenv,
  requests,
}:

buildPythonPackage rec {
  pname = "withings-sync";
  version = "5.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jaroslawhartman";
    repo = "withings-sync";
    tag = "v${version}";
    hash = "sha256-Q9zOXQIdl4jpCK6a5Xp4kZK67MqudX0thDAkRmdL3AQ=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "1.0.0.dev1" "${version}"
  '';

  build-system = [ poetry-core ];

  dependencies = [
    garth
    importlib-resources
    lxml
    python-dotenv
    requests
  ];

  pythonImportsCheck = [ "withings_sync" ];

  meta = {
    description = "Synchronisation of Withings weight";
    homepage = "https://github.com/jaroslawhartman/withings-sync";
    changelog = "https://github.com/jaroslawhartman/withings-sync/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
    mainProgram = "withings-sync";
  };
}