1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 freezegun,
7 geopy,
8 imageio,
9 lxml,
10 numpy,
11 pandas,
12 pillow,
13 pytest-asyncio,
14 pytestCheckHook,
15 python-dateutil,
16 pythonOlder,
17 setuptools,
18 syrupy,
19 voluptuous,
20}:
21
22buildPythonPackage rec {
23 pname = "env-canada";
24 version = "0.11.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.11";
28
29 src = fetchFromGitHub {
30 owner = "michaeldavie";
31 repo = "env_canada";
32 tag = "v${version}";
33 hash = "sha256-r0a2bMgWY6dH88aOJoNpmcSyQi207XDI3Ehu37kU9hY=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 aiohttp
40 geopy
41 imageio
42 lxml
43 numpy
44 pandas
45 pillow
46 python-dateutil
47 voluptuous
48 ];
49
50 nativeCheckInputs = [
51 pytest-asyncio
52 freezegun
53 pytestCheckHook
54 syrupy
55 ];
56
57 disabledTests = [
58 # Tests require network access
59 "test_get_aqhi_regions"
60 "test_update"
61 "test_get_hydro_sites"
62 "test_echydro"
63 "test_get_dimensions"
64 "test_get_latest_frame"
65 "test_get_loop"
66 "test_get_ec_sites"
67 "test_ecradar"
68 "test_historical_number_values"
69 "test_basemap_caching_behavior"
70 "test_layer_image_caching"
71 ];
72
73 pythonImportsCheck = [ "env_canada" ];
74
75 meta = with lib; {
76 description = "Python library to get Environment Canada weather data";
77 homepage = "https://github.com/michaeldavie/env_canada";
78 changelog = "https://github.com/michaeldavie/env_canada/blob/${src.tag}/CHANGELOG.md";
79 license = licenses.mit;
80 maintainers = with maintainers; [ fab ];
81 };
82}