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

Reformat the code with black 24.2 #402

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ignore =
E203,
# line too long
E501,
# multiple statements on one line (def)
E704,
# line break before binary operator
W503,
exclude =
Expand Down
18 changes: 6 additions & 12 deletions pgactivity/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ def execute(
@overload
def cursor(
conn: Connection, mkrow: Callable[..., Row], text_as_bytes: bool
) -> psycopg.Cursor[Row]:
...
) -> psycopg.Cursor[Row]: ...

@overload
def cursor(
conn: Connection, mkrow: None, text_as_bytes: bool
) -> psycopg.Cursor[psycopg.rows.DictRow]:
...
) -> psycopg.Cursor[psycopg.rows.DictRow]: ...

def cursor(
conn: Connection, mkrow: Optional[Callable[..., Row]], text_as_bytes: bool
Expand All @@ -112,8 +110,7 @@ def fetchone(
*,
mkrow: Callable[..., Row],
text_as_bytes: bool = False,
) -> Row:
...
) -> Row: ...

@overload
def fetchone(
Expand All @@ -122,8 +119,7 @@ def fetchone(
args: Union[None, Sequence[Any], Dict[str, Any]] = None,
*,
text_as_bytes: bool = False,
) -> Dict[str, Any]:
...
) -> Dict[str, Any]: ...

def fetchone(
conn: Connection,
Expand All @@ -146,8 +142,7 @@ def fetchall(
*,
mkrow: Callable[..., Row],
text_as_bytes: bool = False,
) -> List[Row]:
...
) -> List[Row]: ...

@overload
def fetchall(
Expand All @@ -156,8 +151,7 @@ def fetchall(
args: Union[None, Sequence[Any], Dict[str, Any]] = None,
*,
text_as_bytes: bool = False,
) -> List[Dict[str, Any]]:
...
) -> List[Dict[str, Any]]: ...

def fetchall(
conn: Connection,
Expand Down
6 changes: 2 additions & 4 deletions pgactivity/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,12 +1058,10 @@ def __iter__(self) -> Iterator[BaseProcess]:
return iter(self.items)

@overload
def __getitem__(self, i: int) -> BaseProcess:
...
def __getitem__(self, i: int) -> BaseProcess: ...

@overload
def __getitem__(self, s: slice) -> List[BaseProcess]:
...
def __getitem__(self, s: slice) -> List[BaseProcess]: ...

def __getitem__(
self, val: Union[int, slice]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies = [
[project.optional-dependencies]
dev = [
"pg-activity[psycopg,psycopg2,testing,typing]",
"black >= 23.1.0",
"black >= 24.2.0",
"check-manifest",
"codespell",
"flake8",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ commands =
skip_install = True
deps =
codespell
black >= 23.1.0
black >= 24.2.0
flake8
isort
commands =
Expand Down
Loading