1{
2 lib,
3 buildPythonPackage,
4 click,
5 fetchFromGitHub,
6 maison,
7 pdm-backend,
8 pytest-freezegun,
9 pytest-xdist,
10 pytest,
11 pytestCheckHook,
12 pythonOlder,
13 ruyaml,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "yamlfix";
19 version = "1.16.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "lyz-code";
26 repo = "yamlfix";
27 rev = "refs/tags/${version}";
28 hash = "sha256-nadyBIzXHbWm0QvympRaYU38tuPJ3TPJg8EbvVv+4L0=";
29 };
30
31 build-system = [
32 setuptools
33 pdm-backend
34 ];
35
36 dependencies = [
37 click
38 maison
39 ruyaml
40 ];
41
42 nativeCheckInputs = [
43 pytest-freezegun
44 pytest-xdist
45 pytestCheckHook
46 ];
47
48 preCheck = ''
49 export HOME=$(mktemp -d)
50 '';
51
52 pythonImportsCheck = [ "yamlfix" ];
53
54 pytestFlagsArray = [
55 "-W"
56 "ignore::DeprecationWarning"
57 ];
58
59 meta = with lib; {
60 description = "Python YAML formatter that keeps your comments";
61 homepage = "https://github.com/lyz-code/yamlfix";
62 changelog = "https://github.com/lyz-code/yamlfix/blob/${version}/CHANGELOG.md";
63 license = licenses.gpl3Only;
64 maintainers = with maintainers; [ koozz ];
65 };
66}