depot/third_party/nixpkgs/pkgs/development/python-modules/weconnect/default.nix
Default email 893b09d324 Project import generated by Copybara.
GitOrigin-RevId: eac07edbd20ed4908b98790ba299250b5527ecdf
2021-12-24 12:21:11 +08:00

58 lines
1.3 KiB
Nix

{ lib
, ascii-magic
, buildPythonPackage
, fetchFromGitHub
, pillow
, pytest-httpserver
, pytestCheckHook
, pythonOlder
, requests
}:
buildPythonPackage rec {
pname = "weconnect";
version = "0.28.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "tillsteinbach";
repo = "WeConnect-python";
rev = "v${version}";
sha256 = "sha256-J7T62L6wT9rkl/Ukf2y5kBbJEdzh2XnGgCgedkxVEmA=";
};
propagatedBuildInputs = [
ascii-magic
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 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 ];
};
}