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 Nov 14, 2024
1 parent 4686f5f commit c17f23e
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 272 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
11 changes: 5 additions & 6 deletions cylc/flow/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
)
import cylc.flow.flags
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 RunMode, StopMode
Expand Down Expand Up @@ -203,10 +202,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[misc]
try:
mode = StopMode(mode)
except ValueError:
Expand Down Expand Up @@ -301,7 +300,7 @@ async def pause(schd: 'Scheduler'):
async def set_verbosity(schd: 'Scheduler', level: Union[int, str]):
"""Set workflow verbosity."""
try:
lvl = int(level)
lvl = int(level.value)
LOG.setLevel(lvl)
except (TypeError, ValueError) as exc:
raise CommandFailedError(exc) from None
Expand Down
Loading

0 comments on commit c17f23e

Please sign in to comment.