1{
2 lib,
3 ascii-magic,
4 buildPythonPackage,
5 fetchFromGitHub,
6 oauthlib,
7 pillow,
8 pytest-cov-stub,
9 pytestCheckHook,
10 pythonOlder,
11 requests,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "weconnect";
17 version = "0.60.8";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "tillsteinbach";
24 repo = "WeConnect-python";
25 tag = "v${version}";
26 hash = "sha256-o8g409R+3lXlwPiDFi9eCzTwcDcZhMEMcc8a1YvlomM=";
27 };
28
29 postPatch = ''
30 substituteInPlace weconnect/__version.py \
31 --replace-fail "0.0.0dev" "${version}"
32 substituteInPlace setup.py \
33 --replace-fail "setup_requires=SETUP_REQUIRED" "setup_requires=[]" \
34 --replace-fail "tests_require=TEST_REQUIRED" "tests_require=[]"
35 substituteInPlace pytest.ini \
36 --replace-fail "required_plugins = pytest-cov" ""
37 '';
38
39 build-system = [ setuptools ];
40
41 dependencies = [
42 oauthlib
43 requests
44 ];
45
46 pythonRelaxDeps = [ "oauthlib" ];
47
48 optional-dependencies = {
49 Images = [
50 ascii-magic
51 pillow
52 ];
53 };
54
55 nativeCheckInputs = [
56 pytest-cov-stub
57 pytestCheckHook
58 ];
59
60 pythonImportsCheck = [ "weconnect" ];
61
62 meta = with lib; {
63 description = "Python client for the Volkswagen WeConnect Services";
64 homepage = "https://github.com/tillsteinbach/WeConnect-python";
65 changelog = "https://github.com/tillsteinbach/WeConnect-python/releases/tag/v${version}";
66 license = licenses.mit;
67 maintainers = with maintainers; [ fab ];
68 };
69}