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 = "22.8.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 sha256 = "sha256-30UHbxs0WZyIVyq0ai2PsoPTkvoYawS1OBhVbV0JVN8=";
24 };
25
26 propagatedBuildInputs = [
27 aiohttp
28 awesomeversion
29 ];
30
31 checkInputs = [
32 aresponses
33 pytest-asyncio
34 pytestCheckHook
35 ];
36
37 postPatch = ''
38 # Upstream doesn't set a version for the tagged releases
39 substituteInPlace setup.py \
40 --replace "main" ${version}
41 '';
42
43
44 pythonImportsCheck = [
45 "pyhaversion"
46 ];
47
48 meta = with lib; {
49 description = "Python module to the newest version number of Home Assistant";
50 homepage = "https://github.com/ludeeus/pyhaversion";
51 changelog = "https://github.com/ludeeus/pyhaversion/releases/tag/${version}";
52 license = with licenses; [ mit ];
53 maintainers = with maintainers; [ makefu ];
54 };
55}