1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pytestCheckHook,
7 pythonOlder,
8 ruamel-yaml,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "cwlformat";
14 version = "2022.02.18";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "rabix";
21 repo = "cwl-format";
22 tag = version;
23 hash = "sha256-FI8hUgb/KglTkubZ+StzptoSsYal71ITyyFNg7j48yk=";
24 };
25
26 patches = [
27 # https://github.com/rabix/cwl-format/pull/21
28 (fetchpatch {
29 name = "fix-for-ruamel-yaml-0.17.23.patch";
30 url = "https://github.com/rabix/cwl-format/commit/9d54330c73c454d2ccacd55e2d51a4145f282041.patch";
31 hash = "sha256-TZGK7T2gzxMvreCLtl3nkuPrqL2KzgrO3yCNmd5lY3g=";
32 })
33 ];
34
35 build-system = [ setuptools ];
36
37 dependencies = [ ruamel-yaml ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 pythonImportsCheck = [ "cwlformat" ];
42
43 disabledTests = [
44 # Test compares output
45 "test_formatting_battery"
46 ];
47
48 meta = with lib; {
49 description = "Code formatter for CWL";
50 homepage = "https://github.com/rabix/cwl-format";
51 changelog = "https://github.com/rabix/cwl-format/releases/tag/${version}";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ fab ];
54 };
55}