Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / open-meteo / default.nix
blob4aec00f312b201bee59fcab2d3c990035914aab8
1 { lib
2 , aiohttp
3 , aresponses
4 , buildPythonPackage
5 , fetchFromGitHub
6 , poetry-core
7 , pydantic
8 , pytest-asyncio
9 , pytestCheckHook
10 , pythonOlder
13 buildPythonPackage rec {
14   pname = "open-meteo";
15   version = "0.2.1";
16   format = "pyproject";
18   disabled = pythonOlder "3.8";
20   src = fetchFromGitHub {
21     owner = "frenck";
22     repo = "python-open-meteo";
23     rev = "v${version}";
24     sha256 = "0i8jmhd29vvkpfxs9l5wy8525ngs79mnc7si2j9b1nc41xrv91f6";
25   };
27   nativeBuildInputs = [
28     poetry-core
29   ];
31   propagatedBuildInputs = [
32     aiohttp
33     aresponses
34     pydantic
35   ];
37   nativeCheckInputs = [
38     pytest-asyncio
39     pytestCheckHook
40   ];
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   '';
50   pythonImportsCheck = [
51     "open_meteo"
52   ];
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   };