Skip to content

Commit bef3c85

Browse files
Fix syntax error in Python 3.8
1 parent 0860b3c commit bef3c85

File tree

2 files changed

+45
-53
lines changed

2 files changed

+45
-53
lines changed

src/gwf/plugins/run.py

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,22 @@ def run(ctx, targets, dry_run, force, no_deps, group):
5050
logger.debug("Cleaning unused log files...")
5151
clean_logs(ctx.working_dir, graph)
5252

53-
with (
54-
create_backend(
55-
ctx.backend, working_dir=ctx.working_dir, config=ctx.config
56-
) as backend,
57-
get_spec_hashes(working_dir=ctx.working_dir, config=ctx.config) as spec_hashes,
58-
):
59-
filters = []
60-
if targets:
61-
filters.append(NameFilter(patterns=targets))
62-
if group:
63-
filters.append(GroupFilter(patterns=group))
53+
with create_backend(ctx.backend, working_dir=ctx.working_dir, config=ctx.config) as backend:
54+
with get_spec_hashes(working_dir=ctx.working_dir, config=ctx.config) as spec_hashes:
55+
filters = []
56+
if targets:
57+
filters.append(NameFilter(patterns=targets))
58+
if group:
59+
filters.append(GroupFilter(patterns=group))
6460

65-
endpoints = set(filter_generic(targets=graph, filters=filters))
66-
submit_workflow(
67-
endpoints,
68-
graph,
69-
fs,
70-
spec_hashes,
71-
backend,
72-
dry_run=dry_run,
73-
force=force,
74-
no_deps=no_deps,
75-
)
61+
endpoints = set(filter_generic(targets=graph, filters=filters))
62+
submit_workflow(
63+
endpoints,
64+
graph,
65+
fs,
66+
spec_hashes,
67+
backend,
68+
dry_run=dry_run,
69+
force=force,
70+
no_deps=no_deps,
71+
)

src/gwf/plugins/status.py

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -150,36 +150,32 @@ def status(ctx, group, status, endpoints, format, targets):
150150
fs = CachedFilesystem()
151151
graph = Graph.from_targets(workflow.targets, fs)
152152

153-
with (
154-
create_backend(
155-
ctx.backend, working_dir=ctx.working_dir, config=ctx.config
156-
) as backend,
157-
get_spec_hashes(working_dir=ctx.working_dir, config=ctx.config) as spec_hashes,
158-
):
159-
target_states = get_status_map(
160-
graph,
161-
fs,
162-
spec_hashes,
163-
backend,
164-
)
153+
with create_backend(ctx.backend, working_dir=ctx.working_dir, config=ctx.config) as backend:
154+
with get_spec_hashes(working_dir=ctx.working_dir, config=ctx.config) as spec_hashes:
155+
target_states = get_status_map(
156+
graph,
157+
fs,
158+
spec_hashes,
159+
backend,
160+
)
165161

166-
filters = []
167-
if status:
168-
filters.append(
169-
StatusFilter(
170-
status_provider=target_states.get,
171-
status=_status_names_to_enums(status),
162+
filters = []
163+
if status:
164+
filters.append(
165+
StatusFilter(
166+
status_provider=target_states.get,
167+
status=_status_names_to_enums(status),
168+
)
172169
)
173-
)
174-
if targets:
175-
filters.append(NameFilter(patterns=targets))
176-
if endpoints:
177-
filters.append(EndpointFilter(endpoints=graph.endpoints()))
178-
if group:
179-
filters.append(GroupFilter(patterns=group))
180-
181-
matches = set(filter_generic(targets=graph, filters=filters))
182-
target_states = {k: v for k, v in target_states.items() if k in matches}
183-
184-
printer = FORMATS[format]
185-
printer(target_states, backend)
170+
if targets:
171+
filters.append(NameFilter(patterns=targets))
172+
if endpoints:
173+
filters.append(EndpointFilter(endpoints=graph.endpoints()))
174+
if group:
175+
filters.append(GroupFilter(patterns=group))
176+
177+
matches = set(filter_generic(targets=graph, filters=filters))
178+
target_states = {k: v for k, v in target_states.items() if k in matches}
179+
180+
printer = FORMATS[format]
181+
printer(target_states, backend)

0 commit comments

Comments
 (0)