1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 mashumaro,
8 orjson,
9 poetry-core,
10 pytest-asyncio,
11 pytest-cov-stub,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "open-meteo";
18 version = "0.4.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.11";
22
23 src = fetchFromGitHub {
24 owner = "frenck";
25 repo = "python-open-meteo";
26 rev = "v${version}";
27 hash = "sha256-J106XeSglyqrFfP1ckbnDwfE7IikaNiBQ+m14PE2SBc=";
28 };
29
30 postPatch = ''
31 # Upstream doesn't set a version for the pyproject.toml
32 substituteInPlace pyproject.toml \
33 --replace-fail "0.0.0" "${version}" \
34 '';
35
36 nativeBuildInputs = [ poetry-core ];
37
38 propagatedBuildInputs = [
39 aiohttp
40 mashumaro
41 orjson
42 ];
43
44 nativeCheckInputs = [
45 aresponses
46 pytest-asyncio
47 pytest-cov-stub
48 pytestCheckHook
49 ];
50
51 disabledTests = [
52 # aiohttp api breakage
53 "test_timeout"
54 ];
55
56 pythonImportsCheck = [ "open_meteo" ];
57
58 meta = with lib; {
59 changelog = "https://github.com/frenck/python-open-meteo/releases/tag/v${version}";
60 description = "Python client for the Open-Meteo API";
61 homepage = "https://github.com/frenck/python-open-meteo";
62 license = licenses.mit;
63 maintainers = with maintainers; [ fab ];
64 };
65}