summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyituran/default.nix
blob: aaac2f756c1238459a956b95b0a89bc582550e05 (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
{
  lib,
  aiohttp,
  buildPythonPackage,
  fetchFromGitHub,
  pytest-asyncio,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pyituran";
  version = "0.1.5";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "shmuelzon";
    repo = "pyituran";
    tag = version;
    hash = "sha256-Nil9bxXzDvwMIVTxeaVUOtJwx92zagA6OzQV3LMR8d8=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail 'os.environ["VERSION"]' '"${version}"'
  '';

  build-system = [ setuptools ];

  dependencies = [ aiohttp ];

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  pythonImportsCheck = [ "pyituran" ];

  meta = {
    description = "Module to interact with the Ituran web service";
    homepage = "https://github.com/shmuelzon/pyituran";
    changelog = "https://github.com/shmuelzon/pyituran/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}