depot/third_party/nixpkgs/pkgs/development/python-modules/pyhaversion/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

62 lines
1.3 KiB
Nix

{
lib,
aiohttp,
aresponses,
awesomeversion,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "pyhaversion";
version = "24.6.1";
pyproject = true;
disabled = pythonOlder "3.12";
src = fetchFromGitHub {
owner = "ludeeus";
repo = "pyhaversion";
rev = "refs/tags/${version}";
hash = "sha256-UZ9236mERoz3WG9MfeN1ALKc8OjqpcbbIhiEsRYzn4I=";
};
postPatch = ''
# Upstream doesn't set a version for the tagged releases
substituteInPlace pyproject.toml \
--replace-fail 'version = "0"' 'version = "${version}"'
'';
build-system = [ poetry-core ];
dependencies = [
aiohttp
awesomeversion
];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
];
pythonImportsCheck = [ "pyhaversion" ];
disabledTests = [
# Error fetching version information from HaVersionSource.SUPERVISOR Server disconnected
"test_stable_version"
"test_etag"
];
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 ];
};
}