Skip to content
Merged
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
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ optional-dependencies = { dev = [
"pytest-asyncio",
"pytest-recording",
"respx",
"ruff>=0.1.3",
"ruff>=0.3.3",
] }

[project.urls]
Expand Down Expand Up @@ -51,7 +51,7 @@ disable = [
]
good-names = ["id"]

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle error
"F", # Pyflakes
Expand All @@ -75,7 +75,7 @@ ignore = [
"W191", # Indentation contains tabs
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Use of assert
"S106", # Possible use of hard-coded password function arguments
Expand Down
6 changes: 2 additions & 4 deletions replicate/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def __iter__(self) -> Iterator[Model]:
return iter([])

@overload
def __getitem__(self, index: int) -> Optional[Model]:
...
def __getitem__(self, index: int) -> Optional[Model]: ...

@overload
def __getitem__(self, index: slice) -> Optional[List[Model]]:
...
def __getitem__(self, index: slice) -> Optional[List[Model]]: ...

def __getitem__(
self, index: Union[int, slice]
Expand Down
2 changes: 1 addition & 1 deletion replicate/identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def parse(cls, ref: str) -> "ModelVersionIdentifier":


def _resolve(
ref: Union["Model", "Version", "ModelVersionIdentifier", str]
ref: Union["Model", "Version", "ModelVersionIdentifier", str],
) -> Tuple[Optional["Version"], Optional[str], Optional[str], Optional[str]]:
from replicate.model import Model # pylint: disable=import-outside-toplevel
from replicate.version import Version # pylint: disable=import-outside-toplevel
Expand Down
2 changes: 1 addition & 1 deletion replicate/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _json_to_model(client: "Client", json: Dict[str, Any]) -> Model:


def _create_prediction_url_from_model(
model: Union[str, Tuple[str, str], "Model"]
model: Union[str, Tuple[str, str], "Model"],
) -> str:
owner, name = None, None
if isinstance(model, Model):
Expand Down
6 changes: 2 additions & 4 deletions replicate/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ def create( # pylint: disable=too-many-arguments
webhook: Optional[str] = None,
webhook_events_filter: Optional[List[str]] = None,
**kwargs,
) -> Training:
...
) -> Training: ...

@overload
def create(
Expand All @@ -240,8 +239,7 @@ def create(
version: Union[str, Version],
input: Optional[Dict[str, Any]] = None,
**params: Unpack["Trainings.CreateTrainingParams"],
) -> Training:
...
) -> Training: ...

def create( # type: ignore
self,
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --extra=dev --output-file=requirements-dev.txt --resolver=backtracking pyproject.toml
# pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
#
annotated-types==0.5.0
# via pydantic
Expand Down Expand Up @@ -68,7 +68,7 @@ pyyaml==6.0.1
# via vcrpy
respx==0.20.2
# via replicate (pyproject.toml)
ruff==0.1.3
ruff==0.3.3
# via replicate (pyproject.toml)
sniffio==1.3.0
# via
Expand Down
2 changes: 1 addition & 1 deletion script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python -m pylint --exit-zero replicate || STATUS=$?
echo ""

echo "Running ruff check"
python -m ruff . || STATUS=$?
python -m ruff check . || STATUS=$?
echo ""

echo "Running ruff format check"
Expand Down