depot/third_party/nixpkgs/pkgs/development/python-modules/sense-energy/default.nix
Default email ae2dc6aea6 Project import generated by Copybara.
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
2024-10-11 07:15:48 +02:00

61 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
aiohttp,
ciso8601,
async-timeout,
kasa-crypt,
orjson,
pythonOlder,
requests,
websocket-client,
websockets,
}:
buildPythonPackage rec {
pname = "sense-energy";
version = "0.13.2";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "scottbonline";
repo = "sense";
rev = "refs/tags/${version}";
hash = "sha256-HE0bMcxfzfaMLDepjwDwV8AXQ3Q/bQt6SqHt7m/UY9I=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
'';
build-system = [ setuptools ];
dependencies = [
aiohttp
async-timeout
kasa-crypt
orjson
ciso8601
requests
websocket-client
websockets
];
# no tests implemented
doCheck = false;
pythonImportsCheck = [ "sense_energy" ];
meta = with lib; {
description = "API for the Sense Energy Monitor";
homepage = "https://github.com/scottbonline/sense";
changelog = "https://github.com/scottbonline/sense/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}