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