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