Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ignore:
- "tests/**"
- "ws_messages_pb2.py"
- "cylc/flow/scripts/report_timings.py"
- "cylc/flow/network/graphql_subscribe.py"

flag_management:
default_rules:
Expand Down
1 change: 1 addition & 0 deletions changes.d/6478.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Major version upgrade for graphene/graphql-core dependencies.
3 changes: 2 additions & 1 deletion conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ dependencies:
- ansimarkup >=1.0.0
- async-timeout>=3.0.0 # [py<3.11]
- colorama >=0.4,<1.0
- graphene >=2.1,<3
- graphql-core >=3.2,<3.3
- graphene >=3.4.0,<3.5
- 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
25 changes: 13 additions & 12 deletions cylc/flow/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
List,
Optional,
TypeVar,
Union,
)

from metomi.isodatetime.parsers import TimePointParser
Expand All @@ -81,7 +80,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.run_modes import RunMode
from cylc.flow.task_id import TaskID
Expand All @@ -90,6 +88,8 @@


if TYPE_CHECKING:
from enum import Enum

from cylc.flow.scheduler import Scheduler

# define a type for command implementations
Expand Down Expand Up @@ -170,7 +170,7 @@ async def set_prereqs_and_outputs(
@_command('stop')
async def stop(
schd: 'Scheduler',
mode: Union[str, 'StopMode'],
mode: 'Optional[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 @@ -208,12 +208,14 @@ 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]
try:
mode = StopMode(mode)
# BACK COMPAT: mode=None
# the mode can be `None` for commands issued from older Cylc
# versions
# From: 8.4
# To: 8.5
# Remove at: 8.x
mode = StopMode(mode.value) if mode else StopMode.REQUEST_CLEAN
except ValueError:
raise CommandFailedError(f"Invalid stop mode: '{mode}'") from None
schd._set_stop(mode)
Expand Down Expand Up @@ -303,14 +305,13 @@ 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)
LOG.setLevel(lvl)
LOG.setLevel(level.value)
except (TypeError, ValueError) as exc:
raise CommandFailedError(exc) from None
cylc.flow.flags.verbosity = log_level_to_verbosity(lvl)
cylc.flow.flags.verbosity = log_level_to_verbosity(level.value)
yield


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
Loading