nixpkgs/pkgs/development/python-modules/pykoplenti/default.nix
Martin Weinelt 38e74f86e5
python310Packages.pykoplenti: Fix build
Convert to pep517 build, substitute illegal version specifier, use hash
and conver the existing hash to an SRI hash.
2023-03-05 23:27:43 +01:00

55 lines
1 KiB
Nix

{ lib
, aiohttp
, buildPythonPackage
, click
, fetchFromGitHub
, prompt-toolkit
, pycryptodome
, pythonOlder
, setuptools
}:
buildPythonPackage rec {
pname = "pykoplenti";
version = "1.0.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "stegm";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-XBOKf3i8xywU/1Kzl+VI1Qnkp9ohpSuDX3AnotD32oo=";
};
nativeBuildInputs = [
setuptools
];
postPatch = ''
# remove with 1.1.0
substituteInPlace setup.cfg \
--replace 'version = unreleased' 'version = ${version}'
'';
propagatedBuildInputs = [
aiohttp
click
prompt-toolkit
pycryptodome
];
# Project has no tests
doCheck = false;
pythonImportsCheck = [ "pykoplenti" ];
meta = with lib; {
description = "Python REST client API for Kostal Plenticore Inverters";
homepage = "https://github.com/stegm/pykoplenti/";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}