Skip to content

Commit 512ad43

Browse files
committed
black 2025 reformat
1 parent 9e346ee commit 512ad43

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

cwl_utils/cwl_v1_0_expression_refactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def escape_expression_field(contents: str) -> str:
4949

5050

5151
def clean_type_ids(
52-
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema]
52+
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema],
5353
) -> Union[cwl.ArraySchema, cwl.InputRecordSchema]:
5454
"""Simplify type identifiers."""
5555
result = copy.deepcopy(cwltype)
@@ -427,7 +427,7 @@ def get_input_for_id(
427427
def find_expressionLib(
428428
processes: Sequence[
429429
Union[cwl.CommandLineTool, cwl.Workflow, cwl.ExpressionTool, cwl.WorkflowStep]
430-
]
430+
],
431431
) -> Optional[list[str]]:
432432
"""
433433
Return the expressionLib from the highest priority InlineJavascriptRequirement.

cwl_utils/cwl_v1_1_expression_refactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def escape_expression_field(contents: str) -> str:
4949

5050

5151
def clean_type_ids(
52-
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema]
52+
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema],
5353
) -> Union[cwl.ArraySchema, cwl.InputRecordSchema]:
5454
"""Simplify type identifiers."""
5555
result = copy.deepcopy(cwltype)
@@ -425,7 +425,7 @@ def get_input_for_id(
425425
def find_expressionLib(
426426
processes: Sequence[
427427
Union[cwl.CommandLineTool, cwl.Workflow, cwl.ExpressionTool, cwl.WorkflowStep]
428-
]
428+
],
429429
) -> Optional[list[str]]:
430430
"""
431431
Return the expressionLib from the highest priority InlineJavascriptRequirement.

cwl_utils/cwl_v1_2_expression_refactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def escape_expression_field(contents: str) -> str:
4949

5050

5151
def clean_type_ids(
52-
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema]
52+
cwltype: Union[cwl.ArraySchema, cwl.InputRecordSchema],
5353
) -> Union[cwl.ArraySchema, cwl.InputRecordSchema]:
5454
"""Simplify type identifiers."""
5555
result = copy.deepcopy(cwltype)
@@ -425,7 +425,7 @@ def get_input_for_id(
425425
def find_expressionLib(
426426
processes: Sequence[
427427
Union[cwl.CommandLineTool, cwl.Workflow, cwl.ExpressionTool, cwl.WorkflowStep]
428-
]
428+
],
429429
) -> Optional[list[str]]:
430430
"""
431431
Return the expressionLib from the highest priority InlineJavascriptRequirement.

cwl_utils/inputs_schema_gen.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66
"""Generate JSON Schema from CWL inputs object."""
77
import argparse
8+
import json
89
import logging
910
import sys
10-
import json
1111
from copy import deepcopy
1212
from pathlib import Path
13-
from typing import Any, List, Union, Dict, Optional
13+
from typing import Any, Dict, List, Optional, Union
1414
from urllib.parse import urlparse
15+
1516
import requests
1617

1718
# Get typeguard from extensions if we're running in python3.8
@@ -22,25 +23,25 @@
2223

2324
from cwl_utils.loghandler import _logger as _cwlutilslogger
2425
from cwl_utils.parser import (
25-
load_document_by_uri,
26+
CommandLineTool,
27+
Directory,
28+
File,
29+
InputArraySchema,
2630
InputArraySchemaTypes,
31+
InputEnumSchema,
2732
InputEnumSchemaTypes,
28-
InputRecordSchemaTypes,
29-
File,
30-
Directory,
31-
WorkflowInputParameter,
3233
InputRecordSchema,
33-
InputEnumSchema,
34-
InputArraySchema,
34+
InputRecordSchemaTypes,
3535
Workflow,
36-
CommandLineTool,
36+
WorkflowInputParameter,
37+
load_document_by_uri,
3738
)
3839
from cwl_utils.utils import (
39-
sanitise_schema_field,
40-
is_uri,
41-
to_pascal_case,
4240
get_value_from_uri,
4341
is_local_uri,
42+
is_uri,
43+
sanitise_schema_field,
44+
to_pascal_case,
4445
)
4546

4647
_logger = logging.getLogger("cwl-inputs-schema-gen") # pylint: disable=invalid-name

cwl_utils/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
import sys
77
import urllib.error
88
import urllib.parse
9-
from urllib.parse import urlparse
109
import urllib.request
1110
from collections.abc import MutableMapping, MutableSequence
1211
from copy import deepcopy
1312
from io import StringIO
14-
from typing import Any, Optional, Union, Dict, List
13+
from typing import Any, Dict, List, Optional, Union
14+
from urllib.parse import urlparse
1515

1616
from ruamel.yaml.main import YAML
1717
from ruamel.yaml.parser import ParserError
@@ -24,8 +24,8 @@
2424
from cwl_utils.parser import InputRecordSchemaTypes
2525

2626
# Load as 1.2 files
27-
from cwl_utils.parser.cwl_v1_2 import InputEnumSchema as InputEnumSchemaV1_2
2827
from cwl_utils.parser.cwl_v1_2 import InputArraySchema as InputArraySchemaV1_2
28+
from cwl_utils.parser.cwl_v1_2 import InputEnumSchema as InputEnumSchemaV1_2
2929

3030
fast_yaml = YAML(typ="safe")
3131

@@ -260,7 +260,7 @@ def to_pascal_case(name: str) -> str:
260260

261261

262262
def sanitise_schema_field(
263-
schema_field_item: Union[Dict[str, Any], str]
263+
schema_field_item: Union[Dict[str, Any], str],
264264
) -> Union[Dict[str, Any], str]:
265265
"""
266266
Schemas need to be resolved before converted to JSON properties.

tests/test_inputs_schema_gen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
"""Tests for cwl-inputs-schema-gen."""
33
from pathlib import Path
44
from typing import Dict
5+
56
import pytest
67
import requests
7-
from jsonschema.exceptions import ValidationError, SchemaError
8+
from jsonschema.exceptions import SchemaError, ValidationError
89
from jsonschema.validators import validate
910
from ruamel.yaml import YAML
1011

1112
from cwl_utils.inputs_schema_gen import cwl_to_jsonschema
12-
from cwl_utils.parser import load_document_by_uri
1313
from cwl_utils.loghandler import _logger as _cwlutilslogger
14+
from cwl_utils.parser import load_document_by_uri
1415

1516
TEST_ROOT_URL = (
1617
"https://raw.githubusercontent.com/common-workflow-language/cwl-v1.2/main/tests"

0 commit comments

Comments
 (0)