1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, pyyaml
7, iso8601
8, requests
9, pycryptodome
10}:
11
12buildPythonPackage rec {
13 pname = "pycarwings2";
14 version = "2.14";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "filcole";
21 repo = pname;
22 rev = "v${version}";
23 hash = "sha256-kqj/NZXqgPUsOnnzMPmIlICHek7RBxksmL3reNBK+bo=";
24 };
25
26 propagatedBuildInputs = [
27 pyyaml
28 iso8601
29 requests
30 pycryptodome
31 ];
32
33 nativeCheckInputs = [
34 pytestCheckHook
35 ];
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace "'pytest-runner'" ""
40 substituteInPlace setup.cfg \
41 --replace " --flake8 --cov=pycarwings2 --cache-clear --ignore=venv --verbose" ""
42 '';
43
44 disabledTests = [
45 # Test requires network access
46 "test_bad_password"
47 ];
48
49 pythonImportsCheck = [
50 "pycarwings2"
51 ];
52
53 meta = with lib; {
54 description = "Python library for interacting with the NissanConnect EV";
55 homepage = "https://github.com/filcole/pycarwings2";
56 changelog = "https://github.com/filcole/pycarwings2/releases/tag/v${version}";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ fab ];
59 };
60}