1{ lib
2, aiohttp
3, aioresponses
4, buildPythonPackage
5, fetchFromGitHub
6, orjson
7, pytest-asyncio
8, pytest-error-for-skips
9, pytestCheckHook
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "accuweather";
15 version = "0.4.0";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "bieniu";
22 repo = pname;
23 rev = version;
24 hash = "sha256-NnDpSOEIqPuPLIr0Ty6yjrs9WRKyhykcdyiRPB/cHEw=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace "pytest-runner" ""
30 substituteInPlace setup.cfg \
31 --replace "--cov --cov-report term-missing" ""
32 '';
33
34 propagatedBuildInputs = [
35 aiohttp
36 orjson
37 ];
38
39 checkInputs = [
40 aioresponses
41 pytest-asyncio
42 pytest-error-for-skips
43 pytestCheckHook
44 ];
45
46 pythonImportsCheck = [
47 "accuweather"
48 ];
49
50 meta = with lib; {
51 description = "Python wrapper for getting weather data from AccuWeather servers";
52 homepage = "https://github.com/bieniu/accuweather";
53 license = licenses.asl20;
54 maintainers = with maintainers; [ jamiemagee ];
55 };
56}