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