about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pydelijn/default.nix
blob: 728160fe8d1fa1e32aed0ba783d34ef6a39d9604 (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
{ lib
, aiohttp
, async-timeout
, buildPythonPackage
, fetchPypi
, pythonOlder
, pytz
}:

buildPythonPackage rec {
  pname = "pydelijn";
  version = "1.1.0";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-xyBq2h3ipUarkjCXq9GIbY7bhsf9729aQwHde3o5K6g=";
  };

  propagatedBuildInputs = [
    aiohttp
    async-timeout
    pytz
  ];

  postPatch = ''
    # Remove with next release
    substituteInPlace setup.py \
      --replace "async_timeout>=3.0.1,<4.0" "async_timeout>=3.0.1"
    # https://github.com/bollewolle/pydelijn/pull/11
    substituteInPlace pydelijn/common.py \
      --replace ", loop=self.loop" ""
  '';

  # Project has no tests
  doCheck = false;

  pythonImportsCheck = [
    "pydelijn"
  ];

  meta = with lib; {
    description = "Python package to retrieve realtime data of passages at stops of De Lijn";
    homepage = "https://github.com/bollewolle/pydelijn";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}