diff --git a/.flake8 b/.flake8 index 0262bc04..d69d6fc1 100644 --- a/.flake8 +++ b/.flake8 @@ -5,6 +5,8 @@ ignore = E203, # line too long E501, + # multiple statements on one line (def) + E704, # line break before binary operator W503, exclude = diff --git a/pgactivity/pg.py b/pgactivity/pg.py index 904b00d1..8206bad4 100644 --- a/pgactivity/pg.py +++ b/pgactivity/pg.py @@ -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 @@ -112,8 +110,7 @@ def fetchone( *, mkrow: Callable[..., Row], text_as_bytes: bool = False, - ) -> Row: - ... + ) -> Row: ... @overload def fetchone( @@ -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, @@ -146,8 +142,7 @@ def fetchall( *, mkrow: Callable[..., Row], text_as_bytes: bool = False, - ) -> List[Row]: - ... + ) -> List[Row]: ... @overload def fetchall( @@ -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, diff --git a/pgactivity/types.py b/pgactivity/types.py index 6133e17d..beb3def9 100644 --- a/pgactivity/types.py +++ b/pgactivity/types.py @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 6fd9f3c3..bc71136d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/tox.ini b/tox.ini index 3e7da008..37031df9 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ commands = skip_install = True deps = codespell - black >= 23.1.0 + black >= 24.2.0 flake8 isort commands =