mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
Adds ruff linting and formatting (#262)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
name: Ruff
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: chartboost/ruff-action@v1
|
||||
@@ -0,0 +1,10 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.1.7
|
||||
hooks:
|
||||
# Run the linter.
|
||||
- id: ruff
|
||||
args: [ --fix ]
|
||||
# Run the formatter.
|
||||
- id: ruff-format
|
||||
@@ -79,7 +79,7 @@ class TaskPlan(BaseModel):
|
||||
tmp_dep_graph = {item.id: set(item.subtasks) for item in self.task_graph}
|
||||
|
||||
def topological_sort(
|
||||
dep_graph: dict[int, set[int]]
|
||||
dep_graph: dict[int, set[int]],
|
||||
) -> Generator[set[int], None, None]:
|
||||
while True:
|
||||
ordered = set(item for item, dep in dep_graph.items() if len(dep) == 0)
|
||||
|
||||
@@ -101,7 +101,7 @@ def delete(file_id: str = typer.Argument(..., help="ID of the file to delete")):
|
||||
help="Monitor the status of a file on OpenAI's servers",
|
||||
)
|
||||
def status(
|
||||
file_id: str = typer.Argument(..., help="ID of the file to check the status of")
|
||||
file_id: str = typer.Argument(..., help="ID of the file to check the status of"),
|
||||
):
|
||||
with console.status(f"Monitoring status of file {file_id}...") as status:
|
||||
while True:
|
||||
|
||||
+3
-1
@@ -2,4 +2,6 @@ openai>=1.1.0
|
||||
pydantic
|
||||
docstring-parser
|
||||
rich
|
||||
aiohttp
|
||||
aiohttp
|
||||
ruff==0.1.7
|
||||
pre-commit==3.5.0
|
||||
@@ -1,4 +1,3 @@
|
||||
from typing import Iterable
|
||||
from openai import OpenAI
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List
|
||||
|
||||
Reference in New Issue
Block a user