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

Run black and update setup.cfg for flake8 to ignore E701 and E704 #609

Merged
merged 1 commit into from
Feb 16, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions faust/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command-line entry point."""

# pragma: no cover
from faust.cli.faust import cli

Expand Down
1 change: 1 addition & 0 deletions faust/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Agents."""

from .agent import Agent, AgentFun, AgentT, SinkT, current_agent
from .manager import AgentManager, AgentManagerT
from .replies import ReplyConsumer
Expand Down
1 change: 1 addition & 0 deletions faust/agents/actor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Actor - Individual Agent instances."""

from typing import Any, AsyncGenerator, AsyncIterator, Coroutine, Optional, Set, cast

from mode import Service
Expand Down
4 changes: 2 additions & 2 deletions faust/agents/agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Agent implementation."""

import asyncio
import typing
from contextlib import suppress
Expand Down Expand Up @@ -79,8 +80,7 @@
from faust.app.base import App as _App
else:

class _App:
... # noqa
class _App: ... # noqa


__all__ = ["Agent"]
Expand Down
1 change: 1 addition & 0 deletions faust/agents/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Agent manager."""

import asyncio
from collections import defaultdict
from typing import Any, Dict, List, Mapping, MutableMapping, MutableSet, Set
Expand Down
1 change: 1 addition & 0 deletions faust/agents/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Models used by agents internally."""

from typing import Any

from faust.models import Record
Expand Down
4 changes: 2 additions & 2 deletions faust/agents/replies.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Agent replies: waiting for replies, sending them, etc."""

import asyncio
from collections import defaultdict
from typing import Any, AsyncIterator, MutableMapping, MutableSet, NamedTuple, Optional
Expand Down Expand Up @@ -33,8 +34,7 @@ def __init__(self, reply_to: str, correlation_id: str = "", **kwargs: Any) -> No
self.__post_init__()
super().__init__(**kwargs)

def __post_init__(self) -> None:
...
def __post_init__(self) -> None: ...

def _verify_correlation_id(self, correlation_id: str) -> None:
if not correlation_id:
Expand Down
1 change: 1 addition & 0 deletions faust/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Application."""

from .base import App, BootStrategy

__all__ = ["App", "BootStrategy"]
4 changes: 2 additions & 2 deletions faust/app/_attached.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Attachments were used before transactions support.
"""

import asyncio
import typing
from collections import defaultdict
Expand Down Expand Up @@ -29,8 +30,7 @@
from faust.events import Event as _Event
else:

class _Event:
... # noqa
class _Event: ... # noqa


__all__ = ["Attachment", "Attachments"]
Expand Down
13 changes: 5 additions & 8 deletions faust/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Everything starts here.

"""

import asyncio
import importlib
import inspect
Expand Down Expand Up @@ -113,17 +114,13 @@
from faust.worker import Worker as _Worker
else:

class _AppCommand:
... # noqa
class _AppCommand: ... # noqa

class _LiveCheck:
... # noqa
class _LiveCheck: ... # noqa

class _Fetcher:
... # noqa
class _Fetcher: ... # noqa

class _Worker:
... # noqa
class _Worker: ... # noqa


__all__ = ["App", "BootStrategy"]
Expand Down
1 change: 1 addition & 0 deletions faust/app/router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Route messages to Faust nodes by partitioning."""

from typing import Tuple

from yarl import URL
Expand Down
1 change: 1 addition & 0 deletions faust/assignor/client_assignment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Client Assignment."""

import copy
from typing import List, Mapping, MutableMapping, Sequence, Set, Tuple, cast

Expand Down
1 change: 1 addition & 0 deletions faust/assignor/cluster_assignment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cluster assignment."""

from typing import List, MutableMapping, Sequence, Set, cast

from faust.models import Record
Expand Down
1 change: 1 addition & 0 deletions faust/assignor/copartitioned_assignor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Copartitioned Assignor."""

from itertools import cycle
from math import ceil, floor
from typing import Iterable, Iterator, MutableMapping, Optional, Sequence, Set
Expand Down
1 change: 1 addition & 0 deletions faust/assignor/leader_assignor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Leader assignor."""

from typing import Any

from mode import Service
Expand Down
1 change: 1 addition & 0 deletions faust/assignor/partition_assignor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Partition assignor."""

import socket
import zlib
from collections import defaultdict
Expand Down
1 change: 1 addition & 0 deletions faust/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Authentication Credentials."""

import ssl
from typing import Any, Optional, Union

Expand Down
1 change: 1 addition & 0 deletions faust/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The stream will iterate over incoming events in the channel.

"""

import asyncio
from typing import (
Any,
Expand Down
1 change: 1 addition & 0 deletions faust/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command-line Interface."""

from .base import AppCommand, Command, argument, call_command, option

__all__ = ["AppCommand", "Command", "argument", "call_command", "option"]
1 change: 1 addition & 0 deletions faust/cli/agents.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust agents`` used to list agents."""

from operator import attrgetter
from typing import Any, Callable, Optional, Sequence, Type, cast

Expand Down
4 changes: 2 additions & 2 deletions faust/cli/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command-line programs using :pypi:`click`."""

import abc
import asyncio
import inspect
Expand Down Expand Up @@ -49,8 +50,7 @@
from faust.app import App as _App
else:

class _App:
... # noqa
class _App: ... # noqa


try:
Expand Down
1 change: 1 addition & 0 deletions faust/cli/clean_versions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust reset`` used to delete local table state."""

from shutil import rmtree

from .base import AppCommand
Expand Down
1 change: 1 addition & 0 deletions faust/cli/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Supports ``bash``, ``ksh``, ``zsh``, etc.
"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions faust/cli/livecheck.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust worker`` used to start application from console."""

from typing import Any

from .worker import worker
Expand Down
1 change: 1 addition & 0 deletions faust/cli/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust model`` used to list details about a model."""

from datetime import datetime
from typing import Any, Optional, Sequence, Type

Expand Down
1 change: 1 addition & 0 deletions faust/cli/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust models`` used to list models available."""

from operator import attrgetter
from typing import Any, Callable, Sequence, Type, cast

Expand Down
1 change: 1 addition & 0 deletions faust/cli/params.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python :pypi:`click` parameter types."""

from typing import Any, Iterable, Optional

import click
Expand Down
1 change: 1 addition & 0 deletions faust/cli/reset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust reset`` used to delete local table state."""

from .base import AppCommand

__all__ = ["reset"]
Expand Down
1 change: 1 addition & 0 deletions faust/cli/send.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust send`` used to send events to agents and topics."""

import asyncio
import random
from typing import Any, Optional
Expand Down
1 change: 1 addition & 0 deletions faust/cli/tables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust tables`` used to list tables."""

from .base import AppCommand

DEFAULT_TABLE_HELP = 'Missing description: use Table(.., help="str")'
Expand Down
1 change: 1 addition & 0 deletions faust/cli/worker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Program ``faust worker`` used to start application from console."""

import asyncio
import os
import platform
Expand Down
3 changes: 1 addition & 2 deletions faust/contrib/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
from raven.handlers.logging import SentryHandler as _SentryHandler
else:

class _SentryHandler:
... # noqa: E701
class _SentryHandler: ... # noqa: E701

Check warning on line 34 in faust/contrib/sentry.py

View check run for this annotation

Codecov / codecov/patch

faust/contrib/sentry.py#L34

Added line #L34 was not covered by tests


__all__ = ["handler_from_dsn", "setup"]
Expand Down
4 changes: 2 additions & 2 deletions faust/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Events received in streams."""

import typing
from types import TracebackType
from typing import Any, Awaitable, Optional, Type, Union, cast
Expand All @@ -21,8 +22,7 @@
from .app.base import App as _App
else:

class _App:
... # noqa
class _App: ... # noqa


USE_EXISTING_KEY = object()
Expand Down
4 changes: 2 additions & 2 deletions faust/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Faust exceptions."""

import typing

__all__ = [
Expand All @@ -25,8 +26,7 @@
from .types.models import FieldDescriptorT as _FieldDescriptorT
else:

class _FieldDescriptorT:
... # noqa
class _FieldDescriptorT: ... # noqa


class FaustError(Exception):
Expand Down
1 change: 1 addition & 0 deletions faust/fixups/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transport registry."""

from typing import Iterator, Type

from mode.utils.imports import FactoryMapping
Expand Down
1 change: 1 addition & 0 deletions faust/fixups/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fixups - Base implementation."""

from typing import Iterable

from faust.types import AppT, FixupT
Expand Down
7 changes: 3 additions & 4 deletions faust/fixups/django.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Django Fixups - Integration with Django."""

import os
import typing
import warnings
Expand All @@ -14,11 +15,9 @@
from django.settings import Settings as _Settings
else:

class _Apps:
... # noqa
class _Apps: ... # noqa

class _Settings:
... # noqa
class _Settings: ... # noqa


__all__ = ["Fixup"]
Expand Down
1 change: 1 addition & 0 deletions faust/joins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Join strategies."""

from typing import Any, Optional, Tuple

from .types import EventT, FieldDescriptorT, JoinableT, JoinT
Expand Down
1 change: 1 addition & 0 deletions faust/livecheck/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""LiveCheck - End-to-end testing of asynchronous systems."""

from .app import LiveCheck
from .case import Case
from .locals import current_test
Expand Down
1 change: 1 addition & 0 deletions faust/livecheck/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""LiveCheck - Faust Application."""

import asyncio
from datetime import timedelta
from typing import (
Expand Down
7 changes: 3 additions & 4 deletions faust/livecheck/case.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""LiveCheck - Test cases."""

import traceback
import typing
from collections import deque
Expand Down Expand Up @@ -29,8 +30,7 @@
from .app import LiveCheck as _LiveCheck
else:

class _LiveCheck:
... # noqa
class _LiveCheck: ... # noqa


__all__ = ["Case"]
Expand Down Expand Up @@ -318,8 +318,7 @@ async def _send_frequency(self) -> None:
if self.app.is_leader():
await self.make_fake_request()

async def make_fake_request(self) -> None:
...
async def make_fake_request(self) -> None: ...

@Service.task
async def _check_frequency(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions faust/livecheck/locals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Locals - Current test & execution context."""

import typing
from typing import Optional

Expand All @@ -10,8 +11,7 @@
from .runners import TestRunner as _TestRunner
else: # pragma: no cover

class _TestRunner:
... # noqa
class _TestRunner: ... # noqa


__all__ = [
Expand Down
1 change: 1 addition & 0 deletions faust/livecheck/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""LiveCheck - Models."""

from datetime import datetime, timezone
from enum import Enum
from typing import Any, Dict, List, Mapping, Optional
Expand Down
Loading
Loading