1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 geopy,
6 hatchling,
7 httpx,
8 numpy,
9 pytest-asyncio,
10 pytest-cov-stub,
11 pytestCheckHook,
12 python-dateutil,
13 pythonOlder,
14 rapidfuzz,
15 scipy,
16 shapely,
17 time-machine,
18 xmltodict,
19}:
20
21buildPythonPackage rec {
22 pname = "avwx-engine";
23 version = "1.9.4";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchFromGitHub {
29 owner = "avwx-rest";
30 repo = "avwx-engine";
31 tag = version;
32 hash = "sha256-x8qb9nAAl7F+w0lHHQtLYwMZYdZ9WhAxJ63jdjlyfhQ=";
33 };
34
35 build-system = [ hatchling ];
36
37 dependencies = [
38 geopy
39 httpx
40 python-dateutil
41 xmltodict
42 ];
43
44 optional-dependencies = {
45 all = [
46 numpy
47 rapidfuzz
48 scipy
49 shapely
50 ];
51 fuzz = [ rapidfuzz ];
52 scipy = [
53 numpy
54 scipy
55 ];
56 shape = [ shapely ];
57 };
58
59 nativeCheckInputs = [
60 pytest-asyncio
61 pytest-cov-stub
62 pytestCheckHook
63 time-machine
64 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
65
66 pythonImportsCheck = [ "avwx" ];
67
68 disabledTests = [
69 # Tests require network access
70 "fetch"
71 "test_nbm_all"
72 "test_station_nearest_ip"
73 ];
74
75 meta = with lib; {
76 description = "Aviation Weather parsing engine";
77 homepage = "https://github.com/avwx-rest/avwx-engine";
78 changelog = "https://github.com/avwx-rest/avwx-engine/blob/${version}/changelog.md";
79 license = licenses.mit;
80 maintainers = with maintainers; [ fab ];
81 };
82}