nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 paho-mqtt,
6 pytest-cov-stub,
7 pytestCheckHook,
8 python-dateutil,
9 setuptools,
10 weconnect,
11}:
12
13buildPythonPackage rec {
14 pname = "weconnect-mqtt";
15 version = "0.49.5";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "tillsteinbach";
20 repo = "WeConnect-mqtt";
21 tag = "v${version}";
22 hash = "sha256-69p7lAO7W+odrm1kLhvB8v4kNKx6IWBUSOQKgrxVCCY=";
23 };
24
25 postPatch = ''
26 substituteInPlace weconnect_mqtt/__version.py \
27 --replace-fail "0.0.0dev" "${version}"
28 substituteInPlace requirements.txt \
29 --replace-fail "weconnect[Images]~=" "weconnect>="
30 substituteInPlace pytest.ini \
31 --replace-fail "required_plugins = pytest-cov" ""
32 '';
33
34 pythonRelaxDeps = [ "python-dateutil" ];
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 paho-mqtt
40 python-dateutil
41 weconnect
42 ]
43 ++ weconnect.optional-dependencies.Images;
44
45 nativeCheckInputs = [
46 pytest-cov-stub
47 pytestCheckHook
48 ];
49
50 pythonImportsCheck = [ "weconnect_mqtt" ];
51
52 meta = {
53 description = "Python client that publishes data from Volkswagen WeConnect";
54 homepage = "https://github.com/tillsteinbach/WeConnect-mqtt";
55 changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/${src.tag}";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ fab ];
58 mainProgram = "weconnect-mqtt";
59 };
60}