2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
aresponses,
|
|
|
|
awesomeversion,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-06-20 14:57:18 +00:00
|
|
|
poetry-core,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
2024-06-20 14:57:18 +00:00
|
|
|
pythonOlder,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyhaversion";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "24.6.1";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
disabled = pythonOlder "3.12";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ludeeus";
|
2024-06-20 14:57:18 +00:00
|
|
|
repo = "pyhaversion";
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-UZ9236mERoz3WG9MfeN1ALKc8OjqpcbbIhiEsRYzn4I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream doesn't set a version for the tagged releases
|
2024-06-20 14:57:18 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail 'version = "0"' 'version = "${version}"'
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
dependencies = [
|
2020-04-24 23:36:52 +00:00
|
|
|
aiohttp
|
2021-01-15 22:18:51 +00:00
|
|
|
awesomeversion
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
aresponses
|
2021-01-15 22:18:51 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pyhaversion" ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Error fetching version information from HaVersionSource.SUPERVISOR Server disconnected
|
|
|
|
"test_stable_version"
|
|
|
|
"test_etag"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Python module to the newest version number of Home Assistant";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ludeeus/pyhaversion";
|
2021-01-15 22:18:51 +00:00
|
|
|
changelog = "https://github.com/ludeeus/pyhaversion/releases/tag/${version}";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ makefu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|