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.5";
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-zhXUzePbgwmBIP7yMT/FcPYdSZC3qJtwEwkHtlfmv3Q=";
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 ]
65 ++ lib.flatten (builtins.attrValues optional-dependencies);
66
67 pythonImportsCheck = [ "avwx" ];
68
69 disabledTests = [
70 # Tests require network access
71 "fetch"
72 "test_nbm_all"
73 "test_station_nearest_ip"
74 ];
75
76 meta = with lib; {
77 description = "Aviation Weather parsing engine";
78 homepage = "https://github.com/avwx-rest/avwx-engine";
79 changelog = "https://github.com/avwx-rest/avwx-engine/blob/${version}/changelog.md";
80 license = licenses.mit;
81 maintainers = with maintainers; [ fab ];
82 };
83}