Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

isort, add proper skips.

BillSchumacher86d3444fb8f9
diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py
index c0bb8d5bc4..6f1e15bef0 100644
--- a/autogpt/agent/agent.py
+++ b/autogpt/agent/agent.py
@@ -3,7 +3,8 @@ from colorama import Fore, Style
from autogpt.app import execute_command, get_command
from autogpt.chat import chat_with_ai, create_chat_message
from autogpt.config import Config
-from autogpt.json_fixes.master_json_fix_method import fix_json_using_multiple_techniques
+from autogpt.json_fixes.master_json_fix_method import \
+ fix_json_using_multiple_techniques
from autogpt.json_validation.validate_json import validate_json
from autogpt.logs import logger, print_assistant_thoughts
from autogpt.speech import say_text
diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.py
index a35da3c2f3..9a62ef61ec 100644
--- a/autogpt/agent/agent_manager.py
+++ b/autogpt/agent/agent_manager.py
@@ -1,9 +1,7 @@
"""Agent manager for managing GPT agents"""
from __future__ import annotations
-from typing import List
-
-from typing import Union
+from typing import List, Union
from autogpt.config.config import Config, Singleton
from autogpt.llm_utils import create_chat_completion
diff --git a/autogpt/app.py b/autogpt/app.py
index 38e9cb5807..10eb98bb3b 100644
--- a/autogpt/app.py
+++ b/autogpt/app.py
@@ -6,22 +6,14 @@ from autogpt.agent.agent_manager import AgentManager
from autogpt.commands.audio_text import read_audio_from_file
from autogpt.commands.command import CommandRegistry, command
from autogpt.commands.evaluate_code import evaluate_code
-from autogpt.commands.execute_code import (
- execute_python_file,
- execute_shell,
- execute_shell_popen,
-)
-from autogpt.commands.file_operations import (
- append_to_file,
- delete_file,
- download_file,
- read_file,
- search_files,
- write_to_file,
- download_file,
-)
+from autogpt.commands.execute_code import (execute_python_file, execute_shell,
+ execute_shell_popen)
+from autogpt.commands.file_operations import (append_to_file, delete_file,
+ download_file, read_file,
+ search_files, write_to_file)
from autogpt.commands.git_operations import clone_repository
-from autogpt.commands.google_search import google_official_search, google_search
+from autogpt.commands.google_search import (google_official_search,
+ google_search)
from autogpt.commands.image_gen import generate_image
from autogpt.commands.improve_code import improve_code
from autogpt.commands.twitter import send_tweet
diff --git a/autogpt/cli.py b/autogpt/cli.py
index aaf1769415..4cf82a6543 100644
--- a/autogpt/cli.py
+++ b/autogpt/cli.py
@@ -74,15 +74,14 @@ def main(
from colorama import Fore
from autogpt.agent.agent import Agent
-
from autogpt.commands.command import CommandRegistry
from autogpt.config import Config, check_openai_api_key
from autogpt.configurator import create_config
from autogpt.logs import logger
from autogpt.memory import get_memory
+ from autogpt.plugins import scan_plugins
from autogpt.prompts.prompt import construct_main_ai_config
from autogpt.utils import get_latest_bulletin
- from autogpt.plugins import scan_plugins
if ctx.invoked_subcommand is None:
cfg = Config()
# TODO: fill in llm values here
diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py
index 5bb45179d3..d850ea6717 100644
--- a/autogpt/commands/file_operations.py
+++ b/autogpt/commands/file_operations.py
@@ -10,13 +10,11 @@ import requests
from colorama import Back, Fore
from requests.adapters import HTTPAdapter, Retry
+from autogpt.commands.command import command
from autogpt.spinner import Spinner
from autogpt.utils import readable_file_size
-
-from autogpt.commands.command import command
from autogpt.workspace import WORKSPACE_PATH, path_in_workspace
-
LOG_FILE = "file_logger.txt"
LOG_FILE_PATH = WORKSPACE_PATH / LOG_FILE
diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.py
index ab607f7b9a..e0e0d70ae8 100644
--- a/autogpt/commands/web_selenium.py
+++ b/autogpt/commands/web_selenium.py
@@ -17,8 +17,8 @@ from selenium.webdriver.support.wait import WebDriverWait
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
-from autogpt.commands.command import command
import autogpt.processing.text as summary
+from autogpt.commands.command import command
from autogpt.config import Config
from autogpt.processing.html import extract_hyperlinks, format_hyperlinks
diff --git a/autogpt/config/config.py b/autogpt/config/config.py
index 5c6856f514..af1bcf0db0 100644
--- a/autogpt/config/config.py
+++ b/autogpt/config/config.py
@@ -1,10 +1,10 @@
"""Configuration class to store the state of bools for different scripts access."""
import os
-
from typing import List
+
import openai
-from auto_gpt_plugin_template import AutoGPTPluginTemplate
import yaml
+from auto_gpt_plugin_template import AutoGPTPluginTemplate
from colorama import Fore
from dotenv import load_dotenv
diff --git a/autogpt/json_fixes/master_json_fix_method.py b/autogpt/json_fixes/master_json_fix_method.py
index a77bf670b8..991a95f207 100644
--- a/autogpt/json_fixes/master_json_fix_method.py
+++ b/autogpt/json_fixes/master_json_fix_method.py
@@ -9,9 +9,7 @@ CFG = Config()
def fix_json_using_multiple_techniques(assistant_reply: str) -> Dict[Any, Any]:
from autogpt.json_fixes.parsing import (
- attempt_to_fix_json_by_finding_outermost_brackets,
- fix_and_parse_json,
- )
+ attempt_to_fix_json_by_finding_outermost_brackets, fix_and_parse_json)
# Parse and print Assistant response
assistant_reply_json = fix_and_parse_json(assistant_reply)
diff --git a/autogpt/llm_utils.py b/autogpt/llm_utils.py
index 48561da94a..d26fb2d699 100644
--- a/autogpt/llm_utils.py
+++ b/autogpt/llm_utils.py
@@ -8,8 +8,8 @@ from colorama import Fore, Style
from openai.error import APIError, RateLimitError
from autogpt.config import Config
-from autogpt.types.openai import Message
from autogpt.logs import logger
+from autogpt.types.openai import Message
CFG = Config()
diff --git a/autogpt/logs.py b/autogpt/logs.py
index df3487f2c1..4ae334329b 100644
--- a/autogpt/logs.py
+++ b/autogpt/logs.py
@@ -204,9 +204,8 @@ logger = Logger()
def print_assistant_thoughts(ai_name, assistant_reply):
"""Prints the assistant's thoughts to the console"""
- from autogpt.json_fixes.bracket_termination import (
- attempt_to_fix_json_by_finding_outermost_brackets,
- )
+ from autogpt.json_fixes.bracket_termination import \
+ attempt_to_fix_json_by_finding_outermost_brackets
from autogpt.json_fixes.parsing import fix_and_parse_json
try:
diff --git a/autogpt/memory/milvus.py b/autogpt/memory/milvus.py
index 44aa72b956..e2b8fea8ff 100644
--- a/autogpt/memory/milvus.py
+++ b/autogpt/memory/milvus.py
@@ -1,5 +1,6 @@
""" Milvus memory storage provider."""
-from pymilvus import Collection, CollectionSchema, DataType, FieldSchema, connections
+from pymilvus import (Collection, CollectionSchema, DataType, FieldSchema,
+ connections)
from autogpt.memory.base import MemoryProviderSingleton, get_ada_embedding
diff --git a/autogpt/models/base_open_ai_plugin.py b/autogpt/models/base_open_ai_plugin.py
index fafd39324e..642145998e 100644
--- a/autogpt/models/base_open_ai_plugin.py
+++ b/autogpt/models/base_open_ai_plugin.py
@@ -1,6 +1,5 @@
"""Handles loading of plugins."""
-from typing import Any, Dict, List, Optional, Tuple, TypedDict
-from typing import TypeVar
+from typing import Any, Dict, List, Optional, Tuple, TypedDict, TypeVar
from auto_gpt_plugin_template import AutoGPTPluginTemplate
diff --git a/autogpt/plugins.py b/autogpt/plugins.py
index 0979b8561f..c6324a54db 100644
--- a/autogpt/plugins.py
+++ b/autogpt/plugins.py
@@ -4,20 +4,19 @@ import importlib
import json
import os
import zipfile
-import openapi_python_client
-import requests
-
from pathlib import Path
-from typing import List, Tuple, Optional
+from typing import List, Optional, Tuple
from urllib.parse import urlparse
from zipimport import zipimporter
+import openapi_python_client
+import requests
+from auto_gpt_plugin_template import AutoGPTPluginTemplate
from openapi_python_client.cli import Config as OpenAPIConfig
+
from autogpt.config import Config
from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin
-from auto_gpt_plugin_template import AutoGPTPluginTemplate
-
def inspect_zip_for_module(zip_path: str, debug: bool = False) -> Optional[str]:
"""
diff --git a/autogpt/token_counter.py b/autogpt/token_counter.py
index b1e59d86df..2d50547b4a 100644
--- a/autogpt/token_counter.py
+++ b/autogpt/token_counter.py
@@ -1,5 +1,6 @@
"""Functions for counting the number of tokens in a message or string."""
from __future__ import annotations
+
from typing import List
import tiktoken
diff --git a/pyproject.toml b/pyproject.toml
index fdb43d66e4..72bb3ff8e0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,6 +14,7 @@ extend-exclude = '.+/(dist|.venv|venv|build)/.+'
[tool.isort]
profile = "black"
+skip = venv,env,node_modules,.env,.venv,dist
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 4be41a9080..8a7771f677 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1,5 +1,5 @@
-import shutil
import os
+import shutil
import sys
from pathlib import Path
diff --git a/tests/unit/models/test_base_open_api_plugin.py b/tests/unit/models/test_base_open_api_plugin.py
index 3dc58d5127..8f49c29503 100644
--- a/tests/unit/models/test_base_open_api_plugin.py
+++ b/tests/unit/models/test_base_open_api_plugin.py
@@ -1,6 +1,9 @@
-import pytest
from typing import Any, Dict, List, Optional, Tuple
-from autogpt.models.base_open_ai_plugin import BaseOpenAIPlugin, Message, PromptGenerator
+
+import pytest
+
+from autogpt.models.base_open_ai_plugin import (BaseOpenAIPlugin, Message,
+ PromptGenerator)
class DummyPlugin(BaseOpenAIPlugin):
diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py
index 58e895bf8f..83656da207 100644
--- a/tests/unit/test_plugins.py
+++ b/tests/unit/test_plugins.py
@@ -1,6 +1,8 @@
import pytest
-from autogpt.plugins import inspect_zip_for_module, scan_plugins, blacklist_whitelist_check
+
from autogpt.config import Config
+from autogpt.plugins import (blacklist_whitelist_check, inspect_zip_for_module,
+ scan_plugins)
PLUGINS_TEST_DIR = "tests/unit/data/test_plugins"
PLUGIN_TEST_ZIP_FILE = "Auto-GPT-Plugin-Test-master.zip"