1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 mashumaro,
8 orjson,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "open-meteo";
17 version = "0.3.1";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.11";
21
22 src = fetchFromGitHub {
23 owner = "frenck";
24 repo = "python-open-meteo";
25 rev = "v${version}";
26 hash = "sha256-IB+dfQ4bb4dMYYQUVH9YbP3arvfgt4SooPlOKP3AVI8=";
27 };
28
29 postPatch = ''
30 # Upstream doesn't set a version for the pyproject.toml
31 substituteInPlace pyproject.toml \
32 --replace "0.0.0" "${version}" \
33 --replace "--cov" ""
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 pytestCheckHook
48 ];
49
50 pythonImportsCheck = [ "open_meteo" ];
51
52 meta = with lib; {
53 changelog = "https://github.com/frenck/python-open-meteo/releases/tag/v${version}";
54 description = "Python client for the Open-Meteo API";
55 homepage = "https://github.com/frenck/python-open-meteo";
56 license = licenses.mit;
57 maintainers = with maintainers; [ fab ];
58 };
59}