mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix use of deprecated `@abc.abstractproperty` decorator
This commit is contained in:
@@ -79,11 +79,13 @@ class ProvidesAppContext:
|
||||
Mixed in class must provide `app` property.
|
||||
"""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def app(self) -> MinimalManagerApp:
|
||||
"""Provide access to the Galaxy ``app`` object."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def url_builder(self) -> Optional[Callable[..., str]]:
|
||||
"""
|
||||
Provide access to Galaxy URLs (if available).
|
||||
@@ -217,7 +219,8 @@ class ProvidesUserContext(ProvidesAppContext):
|
||||
raise AuthenticationRequired("The async task requires user authentication.")
|
||||
return RequestUser(user_id=self.user.id)
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def user(self):
|
||||
"""Provide access to the user object."""
|
||||
|
||||
@@ -290,7 +293,8 @@ class ProvidesHistoryContext(ProvidesUserContext):
|
||||
properties.
|
||||
"""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def history(self) -> Optional[History]:
|
||||
"""Provide access to the user's current history model object.
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
abstractmethod,
|
||||
abstractproperty,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
@@ -65,7 +64,8 @@ class ContainerResolver(Dictifiable, metaclass=ABCMeta):
|
||||
of the tool and its requirements.
|
||||
"""
|
||||
|
||||
@abstractproperty
|
||||
@property
|
||||
@abstractmethod
|
||||
def resolver_type(self) -> str:
|
||||
"""Short label for the type of container resolution."""
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import os.path
|
||||
from abc import (
|
||||
ABCMeta,
|
||||
abstractmethod,
|
||||
abstractproperty,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
@@ -237,7 +236,8 @@ class SpecificationAwareDependencyResolver(metaclass=ABCMeta):
|
||||
class SpecificationPatternDependencyResolver(SpecificationAwareDependencyResolver):
|
||||
"""Implement the :class:`SpecificationAwareDependencyResolver` with a regex pattern."""
|
||||
|
||||
@abstractproperty
|
||||
@property
|
||||
@abstractmethod
|
||||
def _specification_pattern(self):
|
||||
"""Pattern of URI to match against."""
|
||||
|
||||
@@ -275,7 +275,8 @@ class Dependency(Dictifiable, metaclass=ABCMeta):
|
||||
Return shell commands to enable this dependency.
|
||||
"""
|
||||
|
||||
@abstractproperty
|
||||
@property
|
||||
@abstractmethod
|
||||
def exact(self):
|
||||
"""Return true if version information wasn't discarded to resolve
|
||||
the dependency.
|
||||
|
||||
@@ -89,15 +89,18 @@ class WorkRequestContext(ProvidesHistoryContext):
|
||||
class GalaxyAbstractRequest:
|
||||
"""Abstract interface to provide access to some request properties."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def base(self) -> str:
|
||||
"""Base URL of the request."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def host(self) -> str:
|
||||
"""The host address."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def is_secure(self) -> bool:
|
||||
"""Was this a secure (https) request."""
|
||||
|
||||
@@ -109,7 +112,8 @@ class GalaxyAbstractRequest:
|
||||
class GalaxyAbstractResponse:
|
||||
"""Abstract interface to provide access to some response utilities."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def headers(self) -> dict:
|
||||
"""The response headers."""
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ class ProvidesAppContext(Protocol):
|
||||
Mixed in class must provide `app` property.
|
||||
"""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def app(self) -> ToolShedApp:
|
||||
"""Provide access to the shed ``app`` object."""
|
||||
|
||||
@@ -54,7 +55,8 @@ class ProvidesUserContext(ProvidesAppContext, Protocol):
|
||||
properties.
|
||||
"""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def user(self) -> Optional[User]:
|
||||
"""Provide access to the user object."""
|
||||
|
||||
@@ -74,7 +76,8 @@ class ProvidesUserContext(ProvidesAppContext, Protocol):
|
||||
|
||||
|
||||
class ProvidesRepositoriesContext(ProvidesUserContext, Protocol):
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def repositories_hostname(self) -> str:
|
||||
"""Provide access to hostname used by target mercurial server."""
|
||||
|
||||
@@ -86,16 +89,19 @@ class SessionRequestContext(ProvidesRepositoriesContext, Protocol):
|
||||
@abc.abstractmethod
|
||||
def set_galaxy_session(self, galaxy_session: GalaxySession): ...
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def request(self) -> GalaxyAbstractRequest: ...
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def response(self) -> GalaxyAbstractResponse: ...
|
||||
|
||||
@abc.abstractmethod
|
||||
def url_builder(self): ...
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def session_csrf_token(self) -> str: ...
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class ShedBrowser(metaclass=abc.ABCMeta):
|
||||
def submit_form_with_name(self, form_name: str, button="runtool_btn", **kwd):
|
||||
"""Submit the target button."""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def is_twill(self) -> bool:
|
||||
"""Return whether this is a twill browser."""
|
||||
|
||||
|
||||
@@ -150,11 +150,13 @@ class ToolShedInstallationClient(metaclass=abc.ABCMeta):
|
||||
) -> Dict[str, Any]:
|
||||
""""""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def tool_data_path(self) -> str:
|
||||
""""""
|
||||
|
||||
@abc.abstractproperty
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def shed_tool_data_table_conf(self) -> str:
|
||||
""""""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user