{ lib, ascii-magic, buildPythonPackage, fetchFromGitHub, oauthlib, pillow, pytest-cov-stub, pytestCheckHook, pythonOlder, requests, setuptools, }: buildPythonPackage rec { pname = "weconnect"; version = "0.60.8"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "tillsteinbach"; repo = "WeConnect-python"; tag = "v${version}"; hash = "sha256-o8g409R+3lXlwPiDFi9eCzTwcDcZhMEMcc8a1YvlomM="; }; postPatch = '' substituteInPlace weconnect/__version.py \ --replace-fail "0.0.0dev" "${version}" substituteInPlace setup.py \ --replace-fail "setup_requires=SETUP_REQUIRED" "setup_requires=[]" \ --replace-fail "tests_require=TEST_REQUIRED" "tests_require=[]" substituteInPlace pytest.ini \ --replace-fail "required_plugins = pytest-cov" "" ''; build-system = [ setuptools ]; dependencies = [ oauthlib requests ]; optional-dependencies = { Images = [ ascii-magic pillow ]; }; nativeCheckInputs = [ pytest-cov-stub pytestCheckHook ]; pythonImportsCheck = [ "weconnect" ]; meta = with lib; { description = "Python client for the Volkswagen WeConnect Services"; homepage = "https://github.com/tillsteinbach/WeConnect-python"; changelog = "https://github.com/tillsteinbach/WeConnect-python/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; }; }