Skip to content

Commit

Permalink
⬆️ Upgrade Ruff and Black (#968)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tiangolo and pre-commit-ci[bot] authored Jun 4, 2024
1 parent e2f646d commit b560e9d
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.4.7
hooks:
- id: ruff
args:
Expand Down
2 changes: 1 addition & 1 deletion requirements-docs-tests.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# For mkdocstrings and code generator using templates
black >=22.10,<24.0
black >=22.10
4 changes: 2 additions & 2 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pillow==10.1.0
# For image processing by Material for MkDocs
cairosvg==2.7.0
mkdocstrings[python]==0.23.0
griffe-typingdoc==0.2.2
# Enable griffe-typingdoc once dropping Python 3.7 and upgrading typing-extensions
# griffe-typingdoc==0.2.5
# For griffe, it formats with black
black==23.3.0
typer == 0.12.3
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pytest >=7.0.1,<8.0.0
coverage[toml] >=6.2,<8.0
mypy ==1.4.1
ruff ==0.2.0
ruff ==0.4.7
# For FastAPI tests
fastapi >=0.103.2
httpx ==0.24.1
Expand Down
1 change: 0 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -e
set -x

CHECK_JINJA=1 python scripts/generate_select.py
coverage run -m pytest tests
coverage combine
coverage report --show-missing
Expand Down
6 changes: 2 additions & 4 deletions sqlmodel/ext/asyncio/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ async def exec(
bind_arguments: Optional[Dict[str, Any]] = None,
_parent_execute_state: Optional[Any] = None,
_add_event: Optional[Any] = None,
) -> TupleResult[_TSelectParam]:
...
) -> TupleResult[_TSelectParam]: ...

@overload
async def exec(
Expand All @@ -56,8 +55,7 @@ async def exec(
bind_arguments: Optional[Dict[str, Any]] = None,
_parent_execute_state: Optional[Any] = None,
_add_event: Optional[Any] = None,
) -> ScalarResult[_TSelectParam]:
...
) -> ScalarResult[_TSelectParam]: ...

async def exec(
self,
Expand Down
12 changes: 4 additions & 8 deletions sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ def Field(
sa_column_args: Union[Sequence[Any], UndefinedType] = Undefined,
sa_column_kwargs: Union[Mapping[str, Any], UndefinedType] = Undefined,
schema_extra: Optional[Dict[str, Any]] = None,
) -> Any:
...
) -> Any: ...


@overload
Expand Down Expand Up @@ -268,8 +267,7 @@ def Field(
repr: bool = True,
sa_column: Union[Column, UndefinedType] = Undefined, # type: ignore
schema_extra: Optional[Dict[str, Any]] = None,
) -> Any:
...
) -> Any: ...


def Field(
Expand Down Expand Up @@ -361,8 +359,7 @@ def Relationship(
link_model: Optional[Any] = None,
sa_relationship_args: Optional[Sequence[Any]] = None,
sa_relationship_kwargs: Optional[Mapping[str, Any]] = None,
) -> Any:
...
) -> Any: ...


@overload
Expand All @@ -371,8 +368,7 @@ def Relationship(
back_populates: Optional[str] = None,
link_model: Optional[Any] = None,
sa_relationship: Optional[RelationshipProperty[Any]] = None,
) -> Any:
...
) -> Any: ...


def Relationship(
Expand Down
6 changes: 2 additions & 4 deletions sqlmodel/orm/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def exec(
bind_arguments: Optional[Dict[str, Any]] = None,
_parent_execute_state: Optional[Any] = None,
_add_event: Optional[Any] = None,
) -> TupleResult[_TSelectParam]:
...
) -> TupleResult[_TSelectParam]: ...

@overload
def exec(
Expand All @@ -48,8 +47,7 @@ def exec(
bind_arguments: Optional[Dict[str, Any]] = None,
_parent_execute_state: Optional[Any] = None,
_add_event: Optional[Any] = None,
) -> ScalarResult[_TSelectParam]:
...
) -> ScalarResult[_TSelectParam]: ...

def exec(
self,
Expand Down
Loading

0 comments on commit b560e9d

Please sign in to comment.