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