Skip to content

Commit ddc100e

Browse files
authored
Update project for ruff 0.3.3 (#266)
Signed-off-by: Mattt Zmuda <[email protected]>
1 parent 42cd4eb commit ddc100e

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ optional-dependencies = { dev = [
2323
"pytest-asyncio",
2424
"pytest-recording",
2525
"respx",
26-
"ruff>=0.1.3",
26+
"ruff>=0.3.3",
2727
] }
2828

2929
[project.urls]
@@ -51,7 +51,7 @@ disable = [
5151
]
5252
good-names = ["id"]
5353

54-
[tool.ruff]
54+
[tool.ruff.lint]
5555
select = [
5656
"E", # pycodestyle error
5757
"F", # Pyflakes
@@ -75,7 +75,7 @@ ignore = [
7575
"W191", # Indentation contains tabs
7676
]
7777

78-
[tool.ruff.per-file-ignores]
78+
[tool.ruff.lint.per-file-ignores]
7979
"tests/*" = [
8080
"S101", # Use of assert
8181
"S106", # Possible use of hard-coded password function arguments

replicate/collection.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ def __iter__(self) -> Iterator[Model]:
3838
return iter([])
3939

4040
@overload
41-
def __getitem__(self, index: int) -> Optional[Model]:
42-
...
41+
def __getitem__(self, index: int) -> Optional[Model]: ...
4342

4443
@overload
45-
def __getitem__(self, index: slice) -> Optional[List[Model]]:
46-
...
44+
def __getitem__(self, index: slice) -> Optional[List[Model]]: ...
4745

4846
def __getitem__(
4947
self, index: Union[int, slice]

replicate/identifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def parse(cls, ref: str) -> "ModelVersionIdentifier":
3131

3232

3333
def _resolve(
34-
ref: Union["Model", "Version", "ModelVersionIdentifier", str]
34+
ref: Union["Model", "Version", "ModelVersionIdentifier", str],
3535
) -> Tuple[Optional["Version"], Optional[str], Optional[str], Optional[str]]:
3636
from replicate.model import Model # pylint: disable=import-outside-toplevel
3737
from replicate.version import Version # pylint: disable=import-outside-toplevel

replicate/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def _json_to_model(client: "Client", json: Dict[str, Any]) -> Model:
383383

384384

385385
def _create_prediction_url_from_model(
386-
model: Union[str, Tuple[str, str], "Model"]
386+
model: Union[str, Tuple[str, str], "Model"],
387387
) -> str:
388388
owner, name = None, None
389389
if isinstance(model, Model):

replicate/training.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ def create( # pylint: disable=too-many-arguments
230230
webhook: Optional[str] = None,
231231
webhook_events_filter: Optional[List[str]] = None,
232232
**kwargs,
233-
) -> Training:
234-
...
233+
) -> Training: ...
235234

236235
@overload
237236
def create(
@@ -240,8 +239,7 @@ def create(
240239
version: Union[str, Version],
241240
input: Optional[Dict[str, Any]] = None,
242241
**params: Unpack["Trainings.CreateTrainingParams"],
243-
) -> Training:
244-
...
242+
) -> Training: ...
245243

246244
def create( # type: ignore
247245
self,

requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --extra=dev --output-file=requirements-dev.txt --resolver=backtracking pyproject.toml
5+
# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
66
#
77
annotated-types==0.5.0
88
# via pydantic
@@ -68,7 +68,7 @@ pyyaml==6.0.1
6868
# via vcrpy
6969
respx==0.20.2
7070
# via replicate (pyproject.toml)
71-
ruff==0.1.3
71+
ruff==0.3.3
7272
# via replicate (pyproject.toml)
7373
sniffio==1.3.0
7474
# via

script/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ python -m pylint --exit-zero replicate || STATUS=$?
1313
echo ""
1414

1515
echo "Running ruff check"
16-
python -m ruff . || STATUS=$?
16+
python -m ruff check . || STATUS=$?
1717
echo ""
1818

1919
echo "Running ruff format check"

0 commit comments

Comments
 (0)