2021-12-30 13:39:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, maison
|
2024-01-25 14:12:00 +00:00
|
|
|
, pdm-backend
|
|
|
|
, pytest-freezegun
|
2021-12-30 13:39:12 +00:00
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, ruyaml
|
2023-02-02 18:25:31 +00:00
|
|
|
, setuptools
|
2021-12-30 13:39:12 +00:00
|
|
|
}:
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "yamlfix";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.16.0";
|
|
|
|
pyproject = true;
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lyz-code";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "yamlfix";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-nadyBIzXHbWm0QvympRaYU38tuPJ3TPJg8EbvVv+4L0=";
|
2021-12-24 04:21:11 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2024-01-25 14:12:00 +00:00
|
|
|
pdm-backend
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
2023-02-02 18:25:31 +00:00
|
|
|
maison
|
2021-12-30 13:39:12 +00:00
|
|
|
ruyaml
|
|
|
|
];
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-25 14:12:00 +00:00
|
|
|
pytest-freezegun
|
2021-12-30 13:39:12 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"yamlfix"
|
|
|
|
];
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AssertionError: assert ... Fixed <stdin> in...
|
|
|
|
"test_check_one_file_no_changes"
|
|
|
|
"test_config_parsing"
|
|
|
|
"test_corrects_code_from_stdin"
|
|
|
|
"test_corrects_one_file"
|
|
|
|
"test_corrects_three_files"
|
|
|
|
"test_empty_list_inline_comment_indentation"
|
|
|
|
"test_find_files"
|
|
|
|
"test_fix_code_converts_non_valid_false_booleans"
|
|
|
|
"test_ignores_correct_files"
|
|
|
|
"test_include_exclude_files"
|
|
|
|
"test_read_prefixed_environment_variables"
|
|
|
|
"test_section_whitelines"
|
|
|
|
"test_whitelines"
|
|
|
|
"test_sequence_style_env_enum_parsing"
|
|
|
|
"test_verbose_option"
|
|
|
|
"test_enforcing_flow_style_together_with_adjustable_newlines"
|
|
|
|
];
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
meta = with lib; {
|
2021-12-30 13:39:12 +00:00
|
|
|
description = "Python YAML formatter that keeps your comments";
|
2021-12-24 04:21:11 +00:00
|
|
|
homepage = "https://github.com/lyz-code/yamlfix";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/lyz-code/yamlfix/blob/${version}/CHANGELOG.md";
|
|
|
|
license = licenses.gpl3Only;
|
2021-12-24 04:21:11 +00:00
|
|
|
maintainers = with maintainers; [ koozz ];
|
|
|
|
};
|
|
|
|
}
|