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