2021-02-16 17:04:54 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-03-30 09:31:56 +00:00
|
|
|
, fetchpatch
|
2021-02-16 17:04:54 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "metar";
|
2022-01-07 04:07:37 +00:00
|
|
|
version = "1.9.0";
|
2021-02-16 17:04:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-metar";
|
|
|
|
repo = "python-metar";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-pl2NWRfFCYyM2qvBt4Ic3wgbGkYZvAO6pX2Set8zYW8=";
|
2021-02-16 17:04:54 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
patches = [
|
2022-08-12 12:06:08 +00:00
|
|
|
# Fix flapping test; https://github.com/python-metar/python-metar/issues/161
|
2022-03-30 09:31:56 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/python-metar/python-metar/commit/716fa76682e6c2936643d1cf62e3d302ef29aedd.patch";
|
|
|
|
hash = "sha256-y82NN+KDryOiH+eG+2ycXCO9lqQLsah4+YpGn6lM2As=";
|
2022-08-12 12:06:08 +00:00
|
|
|
name = "fix_flapping_test.patch";
|
2022-03-30 09:31:56 +00:00
|
|
|
})
|
2021-02-16 17:04:54 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# Fix circumvent a sometimes impossible test
|
2022-04-03 18:54:34 +00:00
|
|
|
# https://github.com/python-metar/python-metar/issues/165
|
2022-08-12 12:06:08 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/python-metar/python-metar/commit/b675f4816d15fbfc27e23ba9a40cdde8bb06a552.patch";
|
|
|
|
hash = "sha256-v+E3Ckwxb42mpGzi2C3ka96wHvurRNODMU3xLxDoVZI=";
|
|
|
|
name = "fix_impossible_test.patch";
|
|
|
|
})
|
2022-04-03 18:54:34 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
pythonImportsCheck = [ "metar" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python parser for coded METAR weather reports";
|
|
|
|
homepage = "https://github.com/python-metar/python-metar";
|
|
|
|
license = with licenses; [ bsd1 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|