2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
deprecated,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
requests-mock,
|
2022-02-20 05:27:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openevsewifi";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "1.1.2";
|
2022-02-20 05:27:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "miniconfig";
|
|
|
|
repo = "python-openevse-wifi";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-7+BC5WG0JoyHNjgsoJBQRVDpmdXMJCV4bMf6pIaS5qo=";
|
2022-02-20 05:27:41 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
deprecated
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-20 05:27:41 +00:00
|
|
|
requests-mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Switch to poetry-core, https://github.com/miniconfig/python-openevse-wifi/pull/31
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/miniconfig/python-openevse-wifi/commit/1083868dd9f39a8ad7bb17f02cea1b8458e5b82d.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-XGeyi/PchBju1ICgL/ZCDGCbWwIJmLAcHuKaj+kDsI0=";
|
2022-02-20 05:27:41 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'pytest-cov = "^2.8.1"' ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "openevsewifi" ];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Module for communicating with the wifi module from OpenEVSE";
|
|
|
|
homepage = "https://github.com/miniconfig/python-openevse-wifi";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|