depot/third_party/nixpkgs/pkgs/development/python-modules/pyhaversion/default.nix
Default email ce641f4048 Project import generated by Copybara.
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
2021-12-06 17:07:01 +01:00

55 lines
1.1 KiB
Nix

{ lib
, aiohttp
, aresponses
, awesomeversion
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytest-asyncio
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pyhaversion";
version = "21.11.1";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "ludeeus";
repo = pname;
rev = version;
sha256 = "sha256-wh6NJRDgOrEHYEN3QlC4lOZHPnPeiPCJFF1xLoixQ14=";
};
propagatedBuildInputs = [
aiohttp
awesomeversion
];
checkInputs = [
aresponses
pytest-asyncio
pytestCheckHook
];
postPatch = ''
# Upstream doesn't set a version for the tagged releases
substituteInPlace setup.py \
--replace "main" ${version}
'';
pythonImportsCheck = [
"pyhaversion"
];
meta = with lib; {
description = "Python module to the newest version number of Home Assistant";
homepage = "https://github.com/ludeeus/pyhaversion";
changelog = "https://github.com/ludeeus/pyhaversion/releases/tag/${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ makefu ];
};
}