Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump black from 23.12.1 to 24.1.0 #362

Merged
merged 2 commits into from Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lint-requirements.txt
@@ -1,4 +1,4 @@
black==23.12.1
black==24.1.0
codespell==2.2.6
flake8-bugbear==24.1.17
pyupgrade==3.15.0
1 change: 1 addition & 0 deletions streamflow/__main__.py
@@ -1,4 +1,5 @@
"""Default entrypoint for the streamflow module."""

import sys

from streamflow import main
Expand Down
1 change: 1 addition & 0 deletions streamflow/core/asyncache.py
Expand Up @@ -2,6 +2,7 @@
Helpers to use [cachetools](https://github.com/tkem/cachetools) with
asyncio.
"""

import functools
import inspect

Expand Down
3 changes: 1 addition & 2 deletions streamflow/core/context.py
Expand Up @@ -18,8 +18,7 @@
class SchemaEntity(ABC):
@classmethod
@abstractmethod
def get_schema(cls) -> str:
...
def get_schema(cls) -> str: ...


class StreamFlowContext:
Expand Down
36 changes: 12 additions & 24 deletions streamflow/core/data.py
Expand Up @@ -60,8 +60,7 @@ def __init__(self, context: StreamFlowContext):
self.context: StreamFlowContext = context

@abstractmethod
async def close(self) -> None:
...
async def close(self) -> None: ...

@abstractmethod
def get_data_locations(
Expand All @@ -70,18 +69,15 @@ def get_data_locations(
deployment: str | None = None,
location_name: str | None = None,
data_type: DataType | None = None,
) -> MutableSequence[DataLocation]:
...
) -> MutableSequence[DataLocation]: ...

@abstractmethod
def get_source_location(
self, path: str, dst_deployment: str
) -> DataLocation | None:
...
) -> DataLocation | None: ...

@abstractmethod
def invalidate_location(self, location: Location, path: str) -> None:
...
def invalidate_location(self, location: Location, path: str) -> None: ...

@abstractmethod
def register_path(
Expand All @@ -90,14 +86,12 @@ def register_path(
path: str,
relpath: str | None = None,
data_type: DataType = DataType.PRIMARY,
) -> DataLocation:
...
) -> DataLocation: ...

@abstractmethod
def register_relation(
self, src_location: DataLocation, dst_location: DataLocation
) -> None:
...
) -> None: ...

@abstractmethod
async def transfer_data(
Expand All @@ -107,8 +101,7 @@ async def transfer_data(
dst_locations: MutableSequence[Location],
dst_path: str,
writable: bool = False,
) -> None:
...
) -> None: ...


class FileType(Enum):
Expand All @@ -121,23 +114,18 @@ def __init__(self, stream: Any):
self.stream: Any = stream

@abstractmethod
async def close(self):
...
async def close(self): ...

@abstractmethod
async def read(self, size: int | None = None):
...
async def read(self, size: int | None = None): ...

@abstractmethod
async def write(self, data: Any):
...
async def write(self, data: Any): ...


class StreamWrapperContextManager(ABC):
@abstractmethod
async def __aenter__(self) -> StreamWrapper:
...
async def __aenter__(self) -> StreamWrapper: ...

@abstractmethod
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
...
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: ...
42 changes: 14 additions & 28 deletions streamflow/core/deployment.py
Expand Up @@ -62,8 +62,7 @@ class BindingFilter(SchemaEntity):
@abstractmethod
async def get_targets(
self, job: Job, targets: MutableSequence[Target]
) -> MutableSequence[Target]:
...
) -> MutableSequence[Target]: ...


class Connector(SchemaEntity):
Expand All @@ -79,8 +78,7 @@ async def copy_local_to_remote(
dst: str,
locations: MutableSequence[Location],
read_only: bool = False,
) -> None:
...
) -> None: ...

@abstractmethod
async def copy_remote_to_local(
Expand All @@ -89,8 +87,7 @@ async def copy_remote_to_local(
dst: str,
locations: MutableSequence[Location],
read_only: bool = False,
) -> None:
...
) -> None: ...

@abstractmethod
async def copy_remote_to_remote(
Expand All @@ -101,12 +98,10 @@ async def copy_remote_to_remote(
source_location: Location,
source_connector: Connector | None = None,
read_only: bool = False,
) -> None:
...
) -> None: ...

@abstractmethod
async def deploy(self, external: bool) -> None:
...
async def deploy(self, external: bool) -> None: ...

@abstractmethod
async def get_available_locations(
Expand All @@ -115,8 +110,7 @@ async def get_available_locations(
input_directory: str | None = None,
output_directory: str | None = None,
tmp_directory: str | None = None,
) -> MutableMapping[str, AvailableLocation]:
...
) -> MutableMapping[str, AvailableLocation]: ...

@abstractmethod
async def run(
Expand All @@ -131,43 +125,35 @@ async def run(
capture_output: bool = False,
timeout: int | None = None,
job_name: str | None = None,
) -> tuple[Any | None, int] | None:
...
) -> tuple[Any | None, int] | None: ...

@abstractmethod
async def undeploy(self, external: bool) -> None:
...
async def undeploy(self, external: bool) -> None: ...

@abstractmethod
async def get_stream_reader(
self, location: Location, src: str
) -> StreamWrapperContextManager:
...
) -> StreamWrapperContextManager: ...


class DeploymentManager(SchemaEntity):
def __init__(self, context: StreamFlowContext) -> None:
self.context: StreamFlowContext = context

@abstractmethod
async def close(self) -> None:
...
async def close(self) -> None: ...

@abstractmethod
async def deploy(self, deployment_config: DeploymentConfig) -> None:
...
async def deploy(self, deployment_config: DeploymentConfig) -> None: ...

@abstractmethod
def get_connector(self, deployment_name: str) -> Connector | None:
...
def get_connector(self, deployment_name: str) -> Connector | None: ...

@abstractmethod
async def undeploy(self, deployment_name: str) -> None:
...
async def undeploy(self, deployment_name: str) -> None: ...

@abstractmethod
async def undeploy_all(self):
...
async def undeploy_all(self): ...


class DeploymentConfig(Config, PersistableEntity):
Expand Down
12 changes: 6 additions & 6 deletions streamflow/core/exception.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ellipsis statements (...) have been replaced with the pass statements in the exception classes.
The reason is that the new black version puts in a single line the class definition with the dots (black PR 3796), however the flake8 tool raises the error: E701 multiple statements on one line (colon)

Expand Up @@ -7,27 +7,27 @@


class WorkflowException(Exception):
...
pass


class WorkflowDefinitionException(WorkflowException):
...
pass


class WorkflowExecutionException(WorkflowException):
...
pass


class WorkflowProvenanceException(WorkflowException):
...
pass


class FailureHandlingException(WorkflowException):
...
pass


class InvalidPluginException(Exception):
...
pass


class UnrecoverableTokenException(WorkflowException):
Expand Down