diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d8cb188..95752b57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: additional_dependencies: ["bandit[toml]"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.10 + rev: v0.16.5 hooks: - id: ruff-format - id: ruff diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9567a84a..f2643a3c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,6 +84,7 @@ The CLI is built on [typer](https://typer.tiangolo.com/). Each command group is ```python """My command description.""" + from __future__ import annotations from typing import Annotated, Optional import typer @@ -91,6 +92,7 @@ from roboflow.cli._compat import ctx_to_args mycommand_app = typer.Typer(help="Do something", no_args_is_help=True) + @mycommand_app.command("list") def list_things( ctx: typer.Context, @@ -100,6 +102,7 @@ def list_things( args = ctx_to_args(ctx, project=project) _list(args) + def _list(args) -> None: from roboflow.cli._output import output, output_error, suppress_sdk_output @@ -117,6 +120,7 @@ def _list(args) -> None: 2. Register in `roboflow/cli/__init__.py`: ```python from roboflow.cli.handlers.mycommand import mycommand_app + app.add_typer(mycommand_app, name="mycommand") ``` diff --git a/README.md b/README.md index 63b78ead..3ff6b896 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ To use the Roboflow Python package, you first need to authenticate with your Rob ```python import roboflow + roboflow.login() ``` @@ -164,10 +165,10 @@ workspace = rf.workspace() # Export images matching a search query workspace.search_export( - query="class:person", # search query (e.g. "tag:review", "class:dog", "*") - format="coco", # annotation format: coco, yolov8, yolov5, voc, etc. - dataset="my-project", # optional: limit to a specific project - location="./my-export", # optional: output directory + query="class:person", # search query (e.g. "tag:review", "class:dog", "*") + format="coco", # annotation format: coco, yolov8, yolov5, voc, etc. + dataset="my-project", # optional: limit to a specific project + location="./my-export", # optional: output directory ) ``` diff --git a/docs/index.md b/docs/index.md index decfe174..d74ad388 100644 --- a/docs/index.md +++ b/docs/index.md @@ -43,6 +43,7 @@ To use the Roboflow Python package, you first need to authenticate with your Rob ```python import roboflow + roboflow.login() ``` @@ -113,10 +114,10 @@ workspace = rf.workspace() # Export images matching a search query workspace.search_export( - query="class:person", # search query (e.g. "tag:review", "class:dog", "*") - format="coco", # annotation format: coco, yolov8, yolov5, voc, etc. - dataset="my-project", # optional: limit to a specific project - location="./my-export", # optional: output directory + query="class:person", # search query (e.g. "tag:review", "class:dog", "*") + format="coco", # annotation format: coco, yolov8, yolov5, voc, etc. + dataset="my-project", # optional: limit to a specific project + location="./my-export", # optional: output directory ) ```