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