1{
2 lib,
3 aiohttp,
4 aresponses,
5 awesomeversion,
6 buildPythonPackage,
7 fetchFromGitHub,
8 poetry-core,
9 pytest-asyncio,
10 pytestCheckHook,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "pyhaversion";
16 version = "24.6.1";
17 pyproject = true;
18
19 disabled = pythonOlder "3.12";
20
21 src = fetchFromGitHub {
22 owner = "ludeeus";
23 repo = "pyhaversion";
24 tag = version;
25 hash = "sha256-UZ9236mERoz3WG9MfeN1ALKc8OjqpcbbIhiEsRYzn4I=";
26 };
27
28 postPatch = ''
29 # Upstream doesn't set a version for the tagged releases
30 substituteInPlace pyproject.toml \
31 --replace-fail 'version = "0"' 'version = "${version}"'
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 aiohttp
38 awesomeversion
39 ];
40
41 nativeCheckInputs = [
42 aresponses
43 pytest-asyncio
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "pyhaversion" ];
48
49 disabledTests = [
50 # Error fetching version information from HaVersionSource.SUPERVISOR Server disconnected
51 "test_stable_version"
52 "test_etag"
53 ];
54
55 meta = with lib; {
56 description = "Python module to the newest version number of Home Assistant";
57 homepage = "https://github.com/ludeeus/pyhaversion";
58 changelog = "https://github.com/ludeeus/pyhaversion/releases/tag/${version}";
59 license = with licenses; [ mit ];
60 maintainers = with maintainers; [ makefu ];
61 };
62}