Skip to content

Commit

Permalink
graphene/graphql-core v3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland committed Dec 2, 2024
1 parent 9ff50f8 commit b0775d4
Show file tree
Hide file tree
Showing 13 changed files with 318 additions and 326 deletions.
2 changes: 1 addition & 1 deletion conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- ansimarkup >=1.0.0
- async-timeout>=3.0.0
- colorama >=0.4,<1.0
- graphene >=2.1,<3
- graphene >=3.4.3,<4
- graphviz # for static graphing
# Note: can't pin jinja2 any higher than this until we give up on Cylc 7 back-compat
- jinja2 >=3.0,<3.1
Expand Down
16 changes: 8 additions & 8 deletions cylc/flow/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
import cylc.flow.flags
from cylc.flow.flow_mgr import get_flow_nums_set
from cylc.flow.log_level import log_level_to_verbosity
from cylc.flow.network.schema import WorkflowStopMode
from cylc.flow.parsec.exceptions import ParsecError
from cylc.flow.task_id import TaskID
from cylc.flow.workflow_status import (
Expand All @@ -91,6 +90,7 @@


if TYPE_CHECKING:
from enum import Enum
from cylc.flow.scheduler import Scheduler

# define a type for command implementations
Expand Down Expand Up @@ -172,7 +172,7 @@ async def set_prereqs_and_outputs(
@_command('stop')
async def stop(
schd: 'Scheduler',
mode: Union[str, 'StopMode'],
mode: Union[str, 'Enum'],
cycle_point: Optional[str] = None,
# NOTE clock_time YYYY/MM/DD-HH:mm back-compat removed
clock_time: Optional[str] = None,
Expand Down Expand Up @@ -210,10 +210,10 @@ async def stop(
schd._update_workflow_state()
else:
# immediate shutdown
with suppress(KeyError):
# By default, mode from mutation is a name from the
# WorkflowStopMode graphene.Enum, but we need the value
mode = WorkflowStopMode[mode] # type: ignore[misc]
with suppress(AttributeError):
# By default, mode from mutation is a WorkflowStopMode
# graphene.Enum, but we need the value
mode = mode.value # type: ignore

Check warning on line 216 in cylc/flow/commands.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/commands.py#L216

Added line #L216 was not covered by tests
try:
mode = StopMode(mode)
except ValueError:
Expand Down Expand Up @@ -305,10 +305,10 @@ async def pause(schd: 'Scheduler'):


@_command('set_verbosity')
async def set_verbosity(schd: 'Scheduler', level: Union[int, str]):
async def set_verbosity(schd: 'Scheduler', level: 'Enum'):
"""Set workflow verbosity."""
try:
lvl = int(level)
lvl = int(level.value)

Check warning on line 311 in cylc/flow/commands.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/commands.py#L311

Added line #L311 was not covered by tests
LOG.setLevel(lvl)
except (TypeError, ValueError) as exc:
raise CommandFailedError(exc) from None
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/flow_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

def add_flow_opts(parser):
parser.add_option(
"--flow", action="append", dest="flow", metavar="FLOW",
"--flow", action="append", dest="flow", metavar="FLOW", default=[],
help=f'Assign new tasks to all active flows ("{FLOW_ALL}");'
f' no flow ("{FLOW_NONE}"); a new flow ("{FLOW_NEW}");'
f' or a specific flow (e.g. "2"). The default is "{FLOW_ALL}".'
Expand Down
Loading

0 comments on commit b0775d4

Please sign in to comment.