Skip to content

Commit

Permalink
Black and isort formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
msnidal committed May 13, 2023
1 parent 697469e commit 4611742
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/gpt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from gpt_review._gpt_cli import cli


if __name__ == "__main__":
exit_code = cli()
sys.exit(exit_code)
1 change: 0 additions & 1 deletion src/gpt_review/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from gpt_review._gpt_cli import cli


if __name__ == "__main__":
exit_code = cli()
sys.exit(exit_code)
3 changes: 1 addition & 2 deletions src/gpt_review/_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from knack.commands import CommandGroup
from knack.util import CLIError


import gpt_review.constants as C
from gpt_review._command import GPTCommandGroup
from gpt_review._llama_index import _query_index
from gpt_review._openai import _call_gpt
import gpt_review.constants as C
from gpt_review.context import _load_azure_openai_context


Expand Down
2 changes: 1 addition & 1 deletion src/gpt_review/_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import os
from typing import Dict

from git.repo import Repo
from knack import CLICommandsLoader
from knack.arguments import ArgumentsContext
from knack.commands import CommandGroup
from git.repo import Repo

from gpt_review._command import GPTCommandGroup
from gpt_review._review import _request_goal
Expand Down
6 changes: 3 additions & 3 deletions src/gpt_review/_github.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"""GitHub API helpers."""
import logging
import json
import logging
import os
from typing import Dict

import requests
from knack.arguments import ArgumentsContext
from knack import CLICommandsLoader
from knack.arguments import ArgumentsContext
from knack.commands import CommandGroup

from gpt_review._command import GPTCommandGroup
from gpt_review._review import _summarize_files
from gpt_review._repository import _RepositoryClient
from gpt_review._review import _summarize_files


class _GitHubClient(_RepositoryClient):
Expand Down
2 changes: 1 addition & 1 deletion src/gpt_review/_gpt_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""The GPT CLI configuration and utilities."""
from collections import OrderedDict
import os
import sys
from collections import OrderedDict

from knack import CLI, CLICommandsLoader

Expand Down
17 changes: 5 additions & 12 deletions src/gpt_review/_llama_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,18 @@
import logging
import os
from typing import List, Optional
from typing_extensions import override

import openai
from langchain.chat_models import AzureChatOpenAI, ChatOpenAI
from langchain.embeddings import OpenAIEmbeddings
from langchain.llms import AzureOpenAI
from llama_index import (
Document,
GithubRepositoryReader,
GPTVectorStoreIndex,
LLMPredictor,
LangchainEmbedding,
ServiceContext,
SimpleDirectoryReader,
StorageContext,
load_index_from_storage,
)
from llama_index import (Document, GithubRepositoryReader, GPTVectorStoreIndex,
LangchainEmbedding, LLMPredictor, ServiceContext,
SimpleDirectoryReader, StorageContext,
load_index_from_storage)
from llama_index.indices.base import BaseGPTIndex
from llama_index.storage.storage_context import DEFAULT_PERSIST_DIR
from typing_extensions import override

import gpt_review.constants as C
from gpt_review.context import _load_azure_openai_context
Expand Down
7 changes: 3 additions & 4 deletions src/gpt_review/_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
from typing import Dict

import yaml

from knack.arguments import ArgumentsContext
from knack import CLICommandsLoader
from knack.arguments import ArgumentsContext
from knack.commands import CommandGroup

from gpt_review._ask import _ask
from gpt_review._command import GPTCommandGroup
from gpt_review.prompts._prompt import load_bug_yaml, load_coverage_yaml, load_summary_yaml

from gpt_review.prompts._prompt import (load_bug_yaml, load_coverage_yaml,
load_summary_yaml)

_CHECKS = {
"SUMMARY_CHECKS": [
Expand Down
5 changes: 3 additions & 2 deletions src/gpt_review/context.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Context for the Azure OpenAI API and the models."""
import os
from dataclasses import dataclass
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

import openai
import yaml
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

import gpt_review.constants as C

Expand Down
4 changes: 2 additions & 2 deletions src/gpt_review/prompts/_prompt.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Interface for a GPT Prompts."""
import os
import sys
from pathlib import Path
from dataclasses import dataclass
from pathlib import Path

from langchain.prompts import load_prompt, PromptTemplate
from langchain.prompts import PromptTemplate, load_prompt

import gpt_review.constants as C

Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import yaml
from collections import namedtuple

import pytest
import yaml
from llama_index import SimpleDirectoryReader


Expand Down
7 changes: 4 additions & 3 deletions tests/test_gpt_cli.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Pytest for gpt_review/main.py"""
from dataclasses import dataclass
import os
import pytest
import subprocess
import sys
from dataclasses import dataclass

import pytest

from gpt_review._gpt_cli import cli
import gpt_review.constants as C
from gpt_review._gpt_cli import cli


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion tests/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import pytest
from openai.error import RateLimitError

from gpt_review._openai import _call_gpt, _get_model
import gpt_review.constants as C
from gpt_review._openai import _call_gpt, _get_model
from gpt_review.context import _load_azure_openai_context


Expand Down

0 comments on commit 4611742

Please sign in to comment.