depot/third_party/nixpkgs/pkgs/development/python-modules/weconnect/default.nix
Default email bb584b27e9 Project import generated by Copybara.
GitOrigin-RevId: 5181d5945eda382ff6a9ca3e072ed6ea9b547fee
2022-04-15 03:41:22 +02:00

62 lines
1.4 KiB
Nix

{ lib
, ascii-magic
, buildPythonPackage
, fetchFromGitHub
, pillow
, pytest-httpserver
, pytestCheckHook
, pythonOlder
, requests
, oauthlib
}:
buildPythonPackage rec {
pname = "weconnect";
version = "0.37.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "tillsteinbach";
repo = "WeConnect-python";
rev = "v${version}";
sha256 = "sha256-54T4L1MzF2rkKM0AXz+bPBdVL7Izdho6c3AVSXBho2E=";
};
propagatedBuildInputs = [
ascii-magic
oauthlib
pillow
requests
];
checkInputs = [
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 image_extra_requirements.txt \
--replace "pillow~=9.0.1" "pillow"
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";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}