2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
ascii-magic,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
oauthlib,
|
|
|
|
pillow,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
setuptools,
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "weconnect";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.60.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tillsteinbach";
|
|
|
|
repo = "WeConnect-python";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-VM4qCe+VMnfKXioUHTjOeBSniwpq44fvbN1k1jG6puk=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
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 "--cov=weconnect --cov-config=.coveragerc --cov-report html" "" \
|
|
|
|
--replace-fail "required_plugins = pytest-cov" ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-02-20 05:27:41 +00:00
|
|
|
oauthlib
|
2021-12-19 01:06:50 +00:00
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
Images = [
|
|
|
|
ascii-magic
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "weconnect" ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client for the Volkswagen WeConnect Services";
|
|
|
|
homepage = "https://github.com/tillsteinbach/WeConnect-python";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/tillsteinbach/WeConnect-python/releases/tag/v${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|