diff --git a/pyproject.toml b/pyproject.toml index 654c027e..bb94c385 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ optional-dependencies = { dev = [ "pytest-asyncio", "pytest-recording", "respx", - "ruff>=0.1.3", + "ruff>=0.3.3", ] } [project.urls] @@ -51,7 +51,7 @@ disable = [ ] good-names = ["id"] -[tool.ruff] +[tool.ruff.lint] select = [ "E", # pycodestyle error "F", # Pyflakes @@ -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 diff --git a/replicate/collection.py b/replicate/collection.py index 0cfab9d3..1a54586c 100644 --- a/replicate/collection.py +++ b/replicate/collection.py @@ -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] diff --git a/replicate/identifier.py b/replicate/identifier.py index b5844526..30953240 100644 --- a/replicate/identifier.py +++ b/replicate/identifier.py @@ -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 diff --git a/replicate/model.py b/replicate/model.py index ab8e1406..2349fe5e 100644 --- a/replicate/model.py +++ b/replicate/model.py @@ -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): diff --git a/replicate/training.py b/replicate/training.py index 091e1990..1f206603 100644 --- a/replicate/training.py +++ b/replicate/training.py @@ -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( @@ -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, diff --git a/requirements-dev.txt b/requirements-dev.txt index a371f835..f14ac1ad 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 @@ -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 diff --git a/script/lint b/script/lint index 0f0cf79d..e25ada22 100755 --- a/script/lint +++ b/script/lint @@ -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"