1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mypy-extensions,
6 pytest-xdist,
7 pytestCheckHook,
8 pythonOlder,
9 ruamel-yaml,
10 schema-salad,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "cwl-upgrader";
16 version = "1.2.12";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "common-workflow-language";
23 repo = "cwl-upgrader";
24 tag = "v${version}";
25 hash = "sha256-cfEd1XAu31u+NO27d3RNA5lhCpRpYK8NeaCxhQ/1GNU=";
26 };
27
28 postPatch = ''
29 # Version detection doesn't work for schema_salad
30 substituteInPlace pyproject.toml \
31 --replace '"schema_salad",' ""
32 '';
33
34 nativeBuildInputs = [ setuptools ];
35
36 propagatedBuildInputs = [
37 mypy-extensions
38 ruamel-yaml
39 schema-salad
40 ];
41
42 nativeCheckInputs = [
43 pytest-xdist
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "cwlupgrader" ];
48
49 meta = with lib; {
50 description = "Library to upgrade CWL syntax to a newer version";
51 mainProgram = "cwl-upgrader";
52 homepage = "https://github.com/common-workflow-language/cwl-upgrader";
53 changelog = "https://github.com/common-workflow-language/cwl-upgrader/releases/tag/v${version}";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ fab ];
56 };
57}