Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyhaversion / default.nix
blob204b8526d879098a511c94adef5cd11c536010e6
1 { lib
2 , aiohttp
3 , aresponses
4 , awesomeversion
5 , buildPythonPackage
6 , fetchFromGitHub
7 , pythonOlder
8 , pytest-asyncio
9 , pytestCheckHook
12 buildPythonPackage rec {
13   pname = "pyhaversion";
14   version = "23.1.0";
15   format = "setuptools";
17   disabled = pythonOlder "3.8";
19   src = fetchFromGitHub {
20     owner = "ludeeus";
21     repo = pname;
22     rev = "refs/tags/${version}";
23     hash = "sha256-HMJqZn0yzN2dP5WTRCbem1Xw8nyH2Hy7oVP4kEKHHAo=";
24   };
26   postPatch = ''
27     # Upstream doesn't set a version for the tagged releases
28     substituteInPlace setup.py \
29       --replace "main" ${version}
30   '';
32   propagatedBuildInputs = [
33     aiohttp
34     awesomeversion
35   ];
37   nativeCheckInputs = [
38     aresponses
39     pytest-asyncio
40     pytestCheckHook
41   ];
43   pythonImportsCheck = [
44     "pyhaversion"
45   ];
47   disabledTests = [
48     # Error fetching version information from HaVersionSource.SUPERVISOR Server disconnected
49     "test_stable_version"
50     "test_etag"
51   ];
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   };