about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pycarwings2/default.nix
blob: 164a5b3f562f6c7da7c7d82de38a49ce207075b6 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, pyyaml
, iso8601
, requests
, pycryptodome
}:

buildPythonPackage rec {
  pname = "pycarwings2";
  version = "2.12";
  format = "setuptools";

  disabled = pythonOlder "3.5";

  src = fetchFromGitHub {
    owner = "filcole";
    repo = pname;
    # release not tagged: https://github.com/filcole/pycarwings2/issues/33
    rev = "0dc9e7e74cb119614c72c7f955801a366f303c56";
    sha256 = "sha256-3lyAgLuaNrCDvRT2yYkgaDiLPKW9Hbg05cQlMIBUs6o=";
  };

  propagatedBuildInputs = [
    pyyaml
    iso8601
    requests
    pycryptodome
  ];

  checkInputs = [
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "'pytest-runner'" ""
    substituteInPlace setup.cfg \
      --replace " --flake8 --cov=pycarwings2 --cache-clear --ignore=venv --verbose" ""
  '';

  disabledTests = [
    # Test requires network access
    "test_bad_password"
  ];

  pythonImportsCheck = [
    "pycarwings2"
  ];

  meta = with lib; {
    description = "Python library for interacting with the NissanConnect EV";
    homepage = "https://github.com/filcole/pycarwings2";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}