From e3c2ae806b76c4e777bfc82bd440338e37485c29 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 2 Dec 2024 09:45:05 +0100 Subject: [PATCH] Future type annotation --- src/plumpy/base/state_machine.py | 2 ++ src/plumpy/process_comms.py | 4 +++- src/plumpy/process_states.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plumpy/base/state_machine.py b/src/plumpy/base/state_machine.py index 853ca668..2035d4ab 100644 --- a/src/plumpy/base/state_machine.py +++ b/src/plumpy/base/state_machine.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- """The state machine for processes""" +from __future__ import annotations + import enum import functools import inspect diff --git a/src/plumpy/process_comms.py b/src/plumpy/process_comms.py index 39b70d4f..5727bdae 100644 --- a/src/plumpy/process_comms.py +++ b/src/plumpy/process_comms.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- """Module for process level communication functions and classes""" +from __future__ import annotations + import asyncio import logging from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Union, cast @@ -42,7 +44,7 @@ class Intent: STATUS: str = 'status' -MessageType = dict[str, Any] +MessageType = Dict[str, Any] # PAUSE_MSG: MessageType = {INTENT_KEY: Intent.PAUSE, MESSAGE_KEY: None} # PLAY_MSG: MessageType = {INTENT_KEY: Intent.PLAY, MESSAGE_KEY: None} diff --git a/src/plumpy/process_states.py b/src/plumpy/process_states.py index 45178b42..dbbb7bef 100644 --- a/src/plumpy/process_states.py +++ b/src/plumpy/process_states.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +from __future__ import annotations + import sys import traceback from enum import Enum