Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Clean up imports and remove unnecessary blank lines #90

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions src/gpt_review/_llama_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import os
from typing import List, Optional
from typing_extensions import override

import openai
from langchain.chat_models import AzureChatOpenAI
Expand All @@ -12,15 +11,16 @@
Document,
GithubRepositoryReader,
GPTVectorStoreIndex,
LLMPredictor,
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
4 changes: 1 addition & 3 deletions src/gpt_review/_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +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


_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