Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a3ad5d

Browse files
⬆️ Upgrade version of Ruff and reformat (#12032)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent6433c3b commit3a3ad5d

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

‎.github/actions/people/app/main.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ def get_individual_sponsors(settings: Settings):
515515

516516
tiers:DefaultDict[float,Dict[str,SponsorEntity]]=defaultdict(dict)
517517
fornodeinnodes:
518-
tiers[node.tier.monthlyPriceInDollars][
519-
node.sponsorEntity.login
520-
]=node.sponsorEntity
518+
tiers[node.tier.monthlyPriceInDollars][node.sponsorEntity.login]= (
519+
node.sponsorEntity
520+
)
521521
returntiers
522522

523523

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
-id:end-of-file-fixer
1515
-id:trailing-whitespace
1616
-repo:https://github.com/charliermarsh/ruff-pre-commit
17-
rev:v0.2.0
17+
rev:v0.6.1
1818
hooks:
1919
-id:ruff
2020
args:

‎fastapi/dependencies/utils.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ def analyze_param(
342342
ifisinstance(arg, (params.Param,params.Body,params.Depends))
343343
]
344344
iffastapi_specific_annotations:
345-
fastapi_annotation:Union[
346-
FieldInfo,params.Depends,None
347-
]=fastapi_specific_annotations[-1]
345+
fastapi_annotation:Union[FieldInfo,params.Depends,None]= (
346+
fastapi_specific_annotations[-1]
347+
)
348348
else:
349349
fastapi_annotation=None
350350
ifisinstance(fastapi_annotation,FieldInfo):

‎fastapi/routing.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ def __init__(
454454
methods= ["GET"]
455455
self.methods:Set[str]= {method.upper()formethodinmethods}
456456
ifisinstance(generate_unique_id_function,DefaultPlaceholder):
457-
current_generate_unique_id:Callable[
458-
["APIRoute"],str
459-
]=generate_unique_id_function.value
457+
current_generate_unique_id:Callable[[APIRoute],str]= (
458+
generate_unique_id_function.value
459+
)
460460
else:
461461
current_generate_unique_id=generate_unique_id_function
462462
self.unique_id=self.operation_idorcurrent_generate_unique_id(self)
@@ -482,9 +482,9 @@ def __init__(
482482
# By being a new field, no inheritance will be passed as is. A new model
483483
# will always be created.
484484
# TODO: remove when deprecating Pydantic v1
485-
self.secure_cloned_response_field:Optional[
486-
ModelField
487-
]=create_cloned_field(self.response_field)
485+
self.secure_cloned_response_field:Optional[ModelField]= (
486+
create_cloned_field(self.response_field)
487+
)
488488
else:
489489
self.response_field=None# type: ignore
490490
self.secure_cloned_response_field=None

‎fastapi/utils.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
from .routingimportAPIRoute
3535

3636
# Cache for `create_cloned_field`
37-
_CLONED_TYPES_CACHE:MutableMapping[
38-
Type[BaseModel],Type[BaseModel]
39-
]=WeakKeyDictionary()
37+
_CLONED_TYPES_CACHE:MutableMapping[Type[BaseModel],Type[BaseModel]]= (
38+
WeakKeyDictionary()
39+
)
4040

4141

4242
defis_body_allowed_for_status_code(status_code:Union[int,str,None])->bool:

‎requirements-tests.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pytest >=7.1.3,<8.0.0
44
coverage[toml] >= 6.5.0,< 8.0
55
mypy ==1.8.0
6-
ruff ==0.2.0
6+
ruff ==0.6.1
77
dirty-equals ==0.6.0
88
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
99
# probably when including SQLModel

‎tests/test_dependency_contextmanager.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ async def get_sync_context_b_bg(
196196
tasks:BackgroundTasks,state:dict=Depends(context_b)
197197
):
198198
asyncdefbg(state:dict):
199-
state[
200-
"sync_bg"
201-
]=f"sync_bg set - b:{state['context_b']} - a:{state['context_a']}"
199+
state["sync_bg"]= (
200+
f"sync_bg set - b:{state['context_b']} - a:{state['context_a']}"
201+
)
202202

203203
tasks.add_task(bg,state)
204204
returnstate

‎tests/test_inherited_custom_class.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_pydanticv2():
3636
defreturn_fast_uuid():
3737
asyncpg_uuid=MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
3838
assertisinstance(asyncpg_uuid,uuid.UUID)
39-
asserttype(asyncpg_uuid)!=uuid.UUID
39+
asserttype(asyncpg_uuid)isnotuuid.UUID
4040
withpytest.raises(TypeError):
4141
vars(asyncpg_uuid)
4242
return {"fast_uuid":asyncpg_uuid}
@@ -79,7 +79,7 @@ def test_pydanticv1():
7979
defreturn_fast_uuid():
8080
asyncpg_uuid=MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
8181
assertisinstance(asyncpg_uuid,uuid.UUID)
82-
asserttype(asyncpg_uuid)!=uuid.UUID
82+
asserttype(asyncpg_uuid)isnotuuid.UUID
8383
withpytest.raises(TypeError):
8484
vars(asyncpg_uuid)
8585
return {"fast_uuid":asyncpg_uuid}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp