Skip to content

Commit

Permalink
use black-pre-commit-mirror and update black (#8425)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored Sep 9, 2023
1 parent a16863d commit 4e3cddd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ repos:
- id: debug-statements
- id: check-docstring-first

- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.0
hooks:
- id: black

Expand Down
6 changes: 2 additions & 4 deletions src/poetry/installation/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
from poetry.utils.env import Env


class ChefError(Exception):
...
class ChefError(Exception): ...


class ChefBuildError(ChefError):
...
class ChefBuildError(ChefError): ...


class IsolatedEnv(BaseIsolatedEnv):
Expand Down
9 changes: 3 additions & 6 deletions src/poetry/repositories/abstract_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ def name(self) -> str:
return self._name

@abstractmethod
def find_packages(self, dependency: Dependency) -> list[Package]:
...
def find_packages(self, dependency: Dependency) -> list[Package]: ...

@abstractmethod
def search(self, query: str) -> list[Package]:
...
def search(self, query: str) -> list[Package]: ...

@abstractmethod
def package(
self,
name: str,
version: Version,
extras: list[str] | None = None,
) -> Package:
...
) -> Package: ...
3 changes: 1 addition & 2 deletions src/poetry/repositories/cached_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def __init__(
@abstractmethod
def _get_release_info(
self, name: NormalizedName, version: Version
) -> dict[str, Any]:
...
) -> dict[str, Any]: ...

def get_release_info(self, name: NormalizedName, version: Version) -> PackageInfo:
"""
Expand Down
3 changes: 1 addition & 2 deletions tests/plugins/test_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@


class ManagerFactory(Protocol):
def __call__(self, group: str = Plugin.group) -> PluginManager:
...
def __call__(self, group: str = Plugin.group) -> PluginManager: ...


class MyPlugin(Plugin):
Expand Down
20 changes: 8 additions & 12 deletions tests/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def __call__(
installer: Installer | None = None,
executor: Executor | None = None,
environment: Env | None = None,
) -> CommandTester:
...
) -> CommandTester: ...


class SourcesFactory(Protocol):
def __call__(self, poetry: Poetry, sources: Source, config: Config, io: IO) -> None:
...
def __call__(
self, poetry: Poetry, sources: Source, config: Config, io: IO
) -> None: ...


class ProjectFactory(Protocol):
Expand All @@ -48,20 +48,16 @@ def __call__(
source: Path | None = None,
locker_config: dict[str, Any] | None = None,
use_test_locker: bool = True,
) -> Poetry:
...
) -> Poetry: ...


class FixtureDirGetter(Protocol):
def __call__(self, name: str) -> Path:
...
def __call__(self, name: str) -> Path: ...


class FixtureCopier(Protocol):
def __call__(self, relative_path: str, target: Path | None = None) -> Path:
...
def __call__(self, relative_path: str, target: Path | None = None) -> Path: ...


class HTMLPageGetter(Protocol):
def __call__(self, content: str, base_url: str | None = None) -> str:
...
def __call__(self, content: str, base_url: str | None = None) -> str: ...

0 comments on commit 4e3cddd

Please sign in to comment.