summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/thingspeak/default.nix
blob: ba904072e2908bc9405b99d10c865385f6caf05a (about) (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  lib,
  buildPythonPackage,
  docopt,
  fetchFromGitHub,
  poetry-core,
  pytest-vcr,
  pytestCheckHook,
  requests,
  setuptools,
  vcrpy,
}:

buildPythonPackage rec {
  pname = "thingspeak";
  version = "1.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mchwalisz";
    repo = "thingspeak";
    tag = "v${version}";
    hash = "sha256-9YvudzksWp130hkG8WxiX9WHegAVH2TT1vwMbLJ13qE=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "poetry.masonry.api" "poetry.core.masonry.api" \
      --replace-fail 'requires = ["poetry>=0.12"]' 'requires = ["poetry-core"]'
  '';

  build-system = [
    poetry-core
  ];

  dependencies = [
    docopt
    requests
    setuptools
  ];

  nativeCheckInputs = [
    pytest-vcr
    pytestCheckHook
    vcrpy
  ];

  disabledTests = [
    # VCR cassette conflicts with different API keys
    "test_get_with_key"
  ];

  pythonImportsCheck = [
    "thingspeak"
  ];

  meta = {
    description = "Client library for the thingspeak.com API";
    homepage = "https://github.com/mchwalisz/thingspeak";
    changelog = "https://github.com/mchwalisz/thingspeak/releases/tag/v${version}";
    license = lib.licenses.lgpl3Only;
    maintainers = [ lib.maintainers.jamiemagee ];
  };
}