Skip to content

Commit

Permalink
fix: resolve type checking and linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Nov 19, 2024
1 parent 4360508 commit e2cccf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 3 additions & 5 deletions instructor/cli/deprecated_hub.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from typing import Any
import typer
from typer import Typer, Exit, echo
from typer import Exit, echo, Typer

app: Typer = typer.Typer()
app: Typer = Typer(help="Instructor Hub CLI (Deprecated)")

@app.command()
@app.command(name="hub")
def hub() -> None:
"""
This command has been deprecated. The instructor hub is no longer available.
Expand Down
7 changes: 3 additions & 4 deletions tests/llm/test_openai/docs/test_hub.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import pytest
from pytest_examples import find_examples, CodeExample, EvalExample

from pytest_examples import CodeExample, EvalExample

@pytest.mark.skip(reason="Hub functionality is being removed")
def test_format_blog(example: CodeExample, eval_example: EvalExample):
def test_format_blog(example: CodeExample, eval_example: EvalExample) -> None:
"""This test is being skipped as the hub functionality is being removed."""
excluded_sources = [
excluded_sources: list[str] = [
"mistral",
"ollama",
"llama_cpp",
Expand Down
5 changes: 2 additions & 3 deletions tests/test_deprecated_hub.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from typing import Any
from typing import Any, cast
from typer.testing import CliRunner, Result
from instructor.cli.deprecated_hub import app
from typer import Typer

runner: CliRunner = CliRunner()

def test_deprecated_hub_command() -> None:
"""Test that the hub command returns a deprecation message and exits with code 1"""
result: Result[Any] = runner.invoke(app)
result = cast(Result[Any], runner.invoke(app))
assert result.exit_code == 1
assert "instructor hub has been deprecated" in result.stdout
assert "https://python.useinstructor.com/examples/" in result.stdout

0 comments on commit e2cccf6

Please sign in to comment.