summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorljhuang <huang.liujie@99cloud.net>2022-08-03 16:21:36 +0800
committerljhuang <huang.liujie@99cloud.net>2022-08-03 20:37:13 +0800
commit56413aa3c5e630257afcb2c2874c46cd7a3955b1 (patch)
treee5dd47ea3ed2c7d4033cde6467c2128e0452add2
parent3bb577e338b0dcb011863f67b933a35b735c98c4 (diff)
downloadtaskflow-56413aa3c5e630257afcb2c2874c46cd7a3955b1.tar.gz
Replace abc.abstractproperty with property and abc.abstractmethod
Replace abc.abstractproperty with property and abc.abstractmethod, as abc.abstractproperty has been deprecated since python3.3[1] [1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc Change-Id: I1bcecd99d8856c26621a5304d9f7f01f8f111918
-rw-r--r--taskflow/engines/base.py6
-rw-r--r--taskflow/flow.py3
-rw-r--r--taskflow/jobs/base.py18
-rw-r--r--taskflow/persistence/base.py3
4 files changed, 20 insertions, 10 deletions
diff --git a/taskflow/engines/base.py b/taskflow/engines/base.py
index 92ecdbd..3331c1e 100644
--- a/taskflow/engines/base.py
+++ b/taskflow/engines/base.py
@@ -55,11 +55,13 @@ class Engine(object, metaclass=abc.ABCMeta):
"""The options that were passed to this engine on construction."""
return self._options
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def storage(self):
"""The storage unit for this engine."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def statistics(self):
"""A dictionary of runtime statistics this engine has gathered.
diff --git a/taskflow/flow.py b/taskflow/flow.py
index 1a138ff..62c1acd 100644
--- a/taskflow/flow.py
+++ b/taskflow/flow.py
@@ -128,6 +128,7 @@ class Flow(object, metaclass=abc.ABCMeta):
provides.update(item.provides)
return frozenset(provides)
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def requires(self):
"""Set of *unsatisfied* symbol names required by the flow."""
diff --git a/taskflow/jobs/base.py b/taskflow/jobs/base.py
index 3bf5198..70d7f16 100644
--- a/taskflow/jobs/base.py
+++ b/taskflow/jobs/base.py
@@ -142,11 +142,13 @@ class Job(object, metaclass=abc.ABCMeta):
book_data = {}
self._book_data = book_data
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def last_modified(self):
"""The datetime the job was last modified."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def created_on(self):
"""The datetime the job was created on."""
@@ -155,11 +157,13 @@ class Job(object, metaclass=abc.ABCMeta):
"""The board this job was posted on or was created from."""
return self._board
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def state(self):
"""Access the current state of this job."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def priority(self):
"""The :py:class:`~.JobPriority` of this job."""
@@ -397,7 +401,8 @@ class JobBoard(object, metaclass=abc.ABCMeta):
appear (if None then waits forever).
"""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def job_count(self):
"""Returns how many jobs are on this jobboard.
@@ -516,7 +521,8 @@ class JobBoard(object, metaclass=abc.ABCMeta):
:type entity: :py:class:`~taskflow.types.entity.Entity`
"""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def connected(self):
"""Returns if this jobboard is connected."""
diff --git a/taskflow/persistence/base.py b/taskflow/persistence/base.py
index dc041f7..6946b8d 100644
--- a/taskflow/persistence/base.py
+++ b/taskflow/persistence/base.py
@@ -42,7 +42,8 @@ class Backend(object, metaclass=abc.ABCMeta):
class Connection(object, metaclass=abc.ABCMeta):
"""Base class for backend connections."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def backend(self):
"""Returns the backend this connection is associated with."""