Skip to content

Commit

Permalink
type fixes for MyPy 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Nov 13, 2023
1 parent d943c6a commit c2ab3cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cwl_utils/cwl_v1_0_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ def process_workflow_reqs_and_hints(
resourceReq: Optional[cwl.ResourceRequirement] = None
envVarReq: Optional[cwl.EnvVarRequirement] = None
iwdr: Optional[cwl.InitialWorkDirRequirement] = None
if workflow.requirements:
for req in workflow.requirements:
if workflow.requirements is not None:
for req in cast(List[cwl.ProcessRequirement], workflow.requirements):
if req and isinstance(req, cwl.EnvVarRequirement):
if req.envDef:
for index, envDef in enumerate(req.envDef):
Expand All @@ -696,7 +696,7 @@ def process_workflow_reqs_and_hints(
None,
replace_etool,
)
if not envVarReq:
if envVarReq is None:
envVarReq = copy.deepcopy(req)
prop_reqs += (cwl.EnvVarRequirement,)
newEnvDef = copy.deepcopy(envDef)
Expand Down
6 changes: 3 additions & 3 deletions cwl_utils/cwl_v1_1_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ def process_workflow_reqs_and_hints(
resourceReq: Optional[cwl.ResourceRequirement] = None
envVarReq: Optional[cwl.EnvVarRequirement] = None
iwdr: Optional[cwl.InitialWorkDirRequirement] = None
if workflow.requirements:
for req in workflow.requirements:
if workflow.requirements is not None:
for req in cast(List[cwl.ProcessRequirement], workflow.requirements):
if req and isinstance(req, cwl.EnvVarRequirement):
if req.envDef:
for index, envDef in enumerate(req.envDef):
Expand All @@ -696,7 +696,7 @@ def process_workflow_reqs_and_hints(
None,
replace_etool,
)
if not envVarReq:
if envVarReq is None:
envVarReq = copy.deepcopy(req)
prop_reqs += (cwl.EnvVarRequirement,)
newEnvDef = copy.deepcopy(envDef)
Expand Down
6 changes: 3 additions & 3 deletions cwl_utils/cwl_v1_2_expression_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ def process_workflow_reqs_and_hints(
resourceReq: Optional[cwl.ResourceRequirement] = None
envVarReq: Optional[cwl.EnvVarRequirement] = None
iwdr: Optional[cwl.InitialWorkDirRequirement] = None
if workflow.requirements:
for req in workflow.requirements:
if workflow.requirements is not None:
for req in cast(List[cwl.ProcessRequirement], workflow.requirements):
if req and isinstance(req, cwl.EnvVarRequirement):
if req.envDef:
for index, envDef in enumerate(req.envDef):
Expand All @@ -791,7 +791,7 @@ def process_workflow_reqs_and_hints(
None,
replace_etool,
)
if not envVarReq:
if envVarReq is None:
envVarReq = copy.deepcopy(req)
prop_reqs += (cwl.EnvVarRequirement,)
newEnvDef = copy.deepcopy(envDef)
Expand Down

0 comments on commit c2ab3cd

Please sign in to comment.