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