Skip to content

Commit

Permalink
Merge pull request #18433 from nsoranzo/fix_deprecations
Browse files Browse the repository at this point in the history
Fix some deprecations
  • Loading branch information
mvdbeek authored Jul 1, 2024
2 parents 9110349 + ee2ef18 commit a01d2f5
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 24 deletions.
12 changes: 8 additions & 4 deletions lib/galaxy/managers/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -217,7 +219,8 @@ def async_request_user(self) -> RequestUser:
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."""

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tool_util/deps/container_resolvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from abc import (
ABCMeta,
abstractmethod,
abstractproperty,
)
from typing import (
Any,
Expand Down Expand Up @@ -65,7 +64,8 @@ def resolve(
of the tool and its requirements.
"""

@abstractproperty
@property
@abstractmethod
def resolver_type(self) -> str:
"""Short label for the type of container resolution."""

Expand Down
7 changes: 4 additions & 3 deletions lib/galaxy/tool_util/deps/resolvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from abc import (
ABCMeta,
abstractmethod,
abstractproperty,
)
from typing import (
Any,
Expand Down Expand Up @@ -237,7 +236,8 @@ def _expand_specs(self, requirement):
class SpecificationPatternDependencyResolver(SpecificationAwareDependencyResolver):
"""Implement the :class:`SpecificationAwareDependencyResolver` with a regex pattern."""

@abstractproperty
@property
@abstractmethod
def _specification_pattern(self):
"""Pattern of URI to match against."""

Expand Down Expand Up @@ -275,7 +275,8 @@ def shell_commands(self):
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.
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Response,
status,
)
from gxformat2._yaml import ordered_dump
from gxformat2.yaml import ordered_dump
from pydantic import (
UUID1,
UUID4,
Expand Down
12 changes: 8 additions & 4 deletions lib/galaxy/work/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,18 @@ def set_user(self, user):
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."""

Expand All @@ -109,7 +112,8 @@ def get_cookie(self, name):
class GalaxyAbstractResponse:
"""Abstract interface to provide access to some response utilities."""

@abc.abstractproperty
@property
@abc.abstractmethod
def headers(self) -> dict:
"""The response headers."""

Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
convert_and_import_workflow,
ImporterGalaxyInterface,
)
from gxformat2._yaml import ordered_load
from gxformat2.yaml import ordered_load
from requests import Response
from rocrate.rocrate import ROCrate
from typing_extensions import Literal
Expand Down
18 changes: 12 additions & 6 deletions lib/tool_shed/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -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."""

Expand All @@ -74,7 +76,8 @@ def user_is_bootstrap_admin(self) -> bool:


class ProvidesRepositoriesContext(ProvidesUserContext, Protocol):
@abc.abstractproperty
@property
@abc.abstractmethod
def repositories_hostname(self) -> str:
"""Provide access to hostname used by target mercurial server."""

Expand All @@ -86,16 +89,19 @@ def get_galaxy_session(self) -> Optional[GalaxySession]: ...
@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: ...


Expand Down
3 changes: 2 additions & 1 deletion lib/tool_shed/test/base/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def submit_form(self, form_no=-1, button="runtool_btn", form=None, **kwd):
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."""

Expand Down
6 changes: 4 additions & 2 deletions lib/tool_shed/test/base/twilltestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ def update_installed_repository(
) -> 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:
""""""

Expand Down

0 comments on commit a01d2f5

Please sign in to comment.