1{ lib
2, ascii-magic
3, buildPythonPackage
4, fetchFromGitHub
5, pillow
6, pytest-httpserver
7, pytestCheckHook
8, pythonOlder
9, requests
10, oauthlib
11}:
12
13buildPythonPackage rec {
14 pname = "weconnect";
15 version = "0.48.3";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "tillsteinbach";
22 repo = "WeConnect-python";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-GXTjG/3Gk58C6TxKrgtblUZI+xf7Te9OA8HnDvNEIvA=";
25 };
26
27 propagatedBuildInputs = [
28 oauthlib
29 requests
30 ];
31
32 passthru.optional-dependencies = {
33 Images = [
34 ascii-magic
35 pillow
36 ];
37 };
38
39 checkInputs = [
40 pytest-httpserver
41 pytestCheckHook
42 ];
43
44 postPatch = ''
45 substituteInPlace weconnect/__version.py \
46 --replace "develop" "${version}"
47 substituteInPlace setup.py \
48 --replace "setup_requires=SETUP_REQUIRED," "setup_requires=[]," \
49 --replace "tests_require=TEST_REQUIRED," "tests_require=[],"
50 substituteInPlace image_extra_requirements.txt \
51 --replace "pillow~=9.2.0" "pillow"
52 substituteInPlace pytest.ini \
53 --replace "--cov=weconnect --cov-config=.coveragerc --cov-report html" "" \
54 --replace "pytest-cov" ""
55 '';
56
57 pythonImportsCheck = [
58 "weconnect"
59 ];
60
61 meta = with lib; {
62 description = "Python client for the Volkswagen WeConnect Services";
63 homepage = "https://github.com/tillsteinbach/WeConnect-python";
64 license = with licenses; [ mit ];
65 maintainers = with maintainers; [ fab ];
66 };
67}