depot/third_party/nixpkgs/pkgs/development/python-modules/weconnect/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

71 lines
1.7 KiB
Nix

{ lib
, ascii-magic
, buildPythonPackage
, fetchFromGitHub
, pillow
, pytest-httpserver
, pytestCheckHook
, pythonOlder
, requests
, oauthlib
}:
buildPythonPackage rec {
pname = "weconnect";
version = "0.57.0";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "tillsteinbach";
repo = "WeConnect-python";
rev = "refs/tags/v${version}";
hash = "sha256-EqKjDPSjhI03ZwkHyNG4ZbIdrzn7wrjpGfze1Qkk0lk=";
};
propagatedBuildInputs = [
oauthlib
requests
];
passthru.optional-dependencies = {
Images = [
ascii-magic
pillow
];
};
nativeCheckInputs = [
pytest-httpserver
pytestCheckHook
];
postPatch = ''
substituteInPlace weconnect/__version.py \
--replace "develop" "${version}"
substituteInPlace setup.py \
--replace "setup_requires=SETUP_REQUIRED," "setup_requires=[]," \
--replace "tests_require=TEST_REQUIRED," "tests_require=[],"
substituteInPlace requirements.txt \
--replace "requests~=2.29.0" "requests"
substituteInPlace image_extra_requirements.txt \
--replace "pillow~=" "pillow>=" \
--replace "ascii_magic~=" "ascii_magic>="
substituteInPlace pytest.ini \
--replace "--cov=weconnect --cov-config=.coveragerc --cov-report html" "" \
--replace "pytest-cov" ""
'';
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 = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}