1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, poetry-core
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10, pytz
11, yarl
12}:
13
14buildPythonPackage rec {
15 pname = "eiswarnung";
16 version = "1.2.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "klaasnicolaas";
23 repo = "python-eiswarnung";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-PVFAy34+UfNQNdzVdfvNiySrCTaKGuepnTINZYkOsuo=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace '"0.0.0"' '"${version}"' \
31 --replace 'addopts = "--cov"' "" \
32 --replace 'pytz = "^2022.7.1"' 'pytz = "*"'
33 '';
34
35 nativeBuildInputs = [
36 poetry-core
37 ];
38
39 propagatedBuildInputs = [
40 aiohttp
41 pytz
42 yarl
43 ];
44
45 nativeCheckInputs = [
46 aresponses
47 pytest-asyncio
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [
52 "eiswarnung"
53 ];
54
55 meta = with lib; {
56 description = "Module for getting Eiswarning API forecasts";
57 homepage = "https://github.com/klaasnicolaas/python-eiswarnung";
58 changelog = "https://github.com/klaasnicolaas/python-eiswarnung/releases/tag/v${version}";
59 license = with licenses; [ mit ];
60 maintainers = with maintainers; [ fab ];
61 };
62}