about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/yamlfix/default.nix
blob: 7243b3891f403021442fb596b09382a1c2f869d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, buildPythonPackage
, click
, fetchFromGitHub
, pytest-xdist
, pytestCheckHook
, pythonOlder
, ruyaml
}:

buildPythonPackage rec {
  pname = "yamlfix";
  version = "0.8.2";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "lyz-code";
    repo = pname;
    rev = version;
    sha256 = "sha256-YCC4xK1fB5Gyv32JhbSuejtzLNMRnH7iyUpzccVijS0=";
  };

  propagatedBuildInputs = [
    click
    ruyaml
  ];

  checkInputs = [
    pytest-xdist
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'python_paths = "."' ""
  '';

  pytestFlagsArray = [
    "-n"
    "$NIX_BUILD_CORES"
  ];

  pythonImportsCheck = [
    "yamlfix"
  ];

  meta = with lib; {
    description = "Python YAML formatter that keeps your comments";
    homepage = "https://github.com/lyz-code/yamlfix";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ koozz ];
  };
}