1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pytestCheckHook
6}:
7
8buildPythonPackage rec {
9 pname = "metar";
10 version = "1.9.0";
11
12 src = fetchFromGitHub {
13 owner = "python-metar";
14 repo = "python-metar";
15 rev = "v${version}";
16 sha256 = "sha256-pl2NWRfFCYyM2qvBt4Ic3wgbGkYZvAO6pX2Set8zYW8=";
17 };
18
19 patches = [
20 # Fix flapping test; https://github.com/python-metar/python-metar/issues/161
21 (fetchpatch {
22 url = "https://github.com/python-metar/python-metar/commit/716fa76682e6c2936643d1cf62e3d302ef29aedd.patch";
23 hash = "sha256-y82NN+KDryOiH+eG+2ycXCO9lqQLsah4+YpGn6lM2As=";
24 name = "fix_flapping_test.patch";
25 })
26
27 # Fix circumvent a sometimes impossible test
28 # https://github.com/python-metar/python-metar/issues/165
29 (fetchpatch {
30 url = "https://github.com/python-metar/python-metar/commit/b675f4816d15fbfc27e23ba9a40cdde8bb06a552.patch";
31 hash = "sha256-v+E3Ckwxb42mpGzi2C3ka96wHvurRNODMU3xLxDoVZI=";
32 name = "fix_impossible_test.patch";
33 })
34 ];
35
36 checkInputs = [ pytestCheckHook ];
37
38 pythonImportsCheck = [ "metar" ];
39
40 meta = with lib; {
41 description = "Python parser for coded METAR weather reports";
42 homepage = "https://github.com/python-metar/python-metar";
43 license = with licenses; [ bsd1 ];
44 maintainers = with maintainers; [ fab ];
45 };
46}