1{
2 lib,
3 buildPythonPackage,
4 deprecated,
5 fetchFromGitHub,
6 fetchpatch,
7 poetry-core,
8 pytestCheckHook,
9 pythonOlder,
10 requests,
11 requests-mock,
12}:
13
14buildPythonPackage rec {
15 pname = "openevsewifi";
16 version = "1.1.2";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "miniconfig";
23 repo = "python-openevse-wifi";
24 rev = "v${version}";
25 hash = "sha256-7+BC5WG0JoyHNjgsoJBQRVDpmdXMJCV4bMf6pIaS5qo=";
26 };
27
28 nativeBuildInputs = [ poetry-core ];
29
30 propagatedBuildInputs = [
31 deprecated
32 requests
33 ];
34
35 nativeCheckInputs = [
36 requests-mock
37 pytestCheckHook
38 ];
39
40 patches = [
41 # Switch to poetry-core, https://github.com/miniconfig/python-openevse-wifi/pull/31
42 (fetchpatch {
43 name = "switch-to-poetry-core.patch";
44 url = "https://github.com/miniconfig/python-openevse-wifi/commit/1083868dd9f39a8ad7bb17f02cea1b8458e5b82d.patch";
45 hash = "sha256-XGeyi/PchBju1ICgL/ZCDGCbWwIJmLAcHuKaj+kDsI0=";
46 })
47 ];
48
49 postPatch = ''
50 substituteInPlace pyproject.toml \
51 --replace 'pytest-cov = "^2.8.1"' ""
52 '';
53
54 pythonImportsCheck = [ "openevsewifi" ];
55
56 meta = with lib; {
57 description = "Module for communicating with the wifi module from OpenEVSE";
58 homepage = "https://github.com/miniconfig/python-openevse-wifi";
59 license = with licenses; [ mit ];
60 maintainers = with maintainers; [ fab ];
61 };
62}