Skip to content
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
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,13 @@ repos:
description: The uncompromising Python code formatter.
language_version: python3

# - repo: https://github.com/pycqa/isort
# rev: 6.0.1
# hooks:
# - id: isort
# name: 🐍 isort - Import Sorter
# description: A Python utility / library to sort imports.
# args: [--profile=black]
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
name: 🐍 isort - Import Sorter
description: A Python utility / library to sort imports.
args: [--profile=black]

# - repo: https://github.com/asottile/pyupgrade
# rev: v3.20.0
Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/deploy/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console


Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import make_authenticated_request
from cforge.common.render import print_json
Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/a2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Optional
import json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be a newline before this. It looks like this change (a newline between the from and import sections) is true in all the files, so probably still some subtle setting to fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed lines_between_types = 1 in the config!


# Third-Party
import typer

# First-Party
from mcpgateway.schemas import A2AAgentCreate, A2AAgentUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import A2AAgentCreate, A2AAgentUpdate


def a2a_list(
Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/mcp_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Optional
import json

# Third-Party
import typer

# First-Party
from mcpgateway.schemas import GatewayCreate, GatewayUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import GatewayCreate, GatewayUpdate


def mcp_servers_list(
Expand Down
4 changes: 2 additions & 2 deletions cforge/commands/resources/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.errors import AuthenticationError, CaseInsensitiveEnum, CLIError, handle_exception
from cforge.common.errors import AuthenticationError, CLIError, CaseInsensitiveEnum, handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.render import print_json, print_table

Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Any, Dict, Optional
import json

# Third-Party
import typer

# First-Party
from mcpgateway.schemas import PromptCreate, PromptUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import PromptCreate, PromptUpdate


def prompts_list(
Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Any, Dict, Optional
import json

# Third-Party
import typer

# First-Party
from mcpgateway.schemas import ResourceCreate, ResourceUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import ResourceCreate, ResourceUpdate


def resources_list(
Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Any, Dict, Optional
import json

# Third-Party
import typer

# First-Party
from mcpgateway.schemas import ToolCreate, ToolUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import CLIError, handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_json_schema, prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import ToolCreate, ToolUpdate


def tools_list(
Expand Down
6 changes: 4 additions & 2 deletions cforge/commands/resources/virtual_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
"""

# Standard
import json
from pathlib import Path
from typing import Optional
import json

# Third-Party
import typer

# First-Party
from mcpgateway.schemas import ServerCreate, ServerUpdate

# Local
from cforge.common.console import get_console
from cforge.common.errors import handle_exception
from cforge.common.http import make_authenticated_request
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from mcpgateway.schemas import ServerCreate, ServerUpdate


def _fixup_payload(data: dict) -> dict:
Expand Down
7 changes: 4 additions & 3 deletions cforge/commands/server/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"""

# Standard
from typing import List, Optional
import atexit
import multiprocessing
import os
import time
from typing import List, Optional

# Third-Party
import requests
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import make_authenticated_request

Expand Down Expand Up @@ -163,7 +163,8 @@ def run(
args.append("--jsonResponse")

# Import top-level translate here to avoid undesirable initialization
# Third Party

# First-Party
from mcpgateway.translate import main as translate_main

# Launch the translation wrapper in a subprocess
Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/server/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import typer
import uvicorn

# First-Party
# Local
from cforge.config import get_settings, set_serve_settings

# ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cforge/commands/settings/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"""

# Standard
import json
from pathlib import Path
from typing import Optional
import json

# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.render import print_json
from cforge.config import get_settings
Expand Down
4 changes: 2 additions & 2 deletions cforge/commands/settings/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

# Standard
from datetime import datetime
import json
from pathlib import Path
from typing import Any, Dict, Optional
import json

# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import get_base_url, make_authenticated_request

Expand Down
4 changes: 2 additions & 2 deletions cforge/commands/settings/import_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"""

# Standard
import json
from pathlib import Path
from typing import Optional
import json

# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import make_authenticated_request

Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/settings/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import requests
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import get_base_url, get_token_file, save_token

Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/settings/logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
CLI command: logout
"""

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import get_token_file

Expand Down
8 changes: 4 additions & 4 deletions cforge/commands/settings/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@

# Standard
from datetime import datetime
import json
from pathlib import Path
from typing import Optional
import json
import secrets
import string
from typing import Optional

# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.prompting import prompt_for_schema
from cforge.common.render import print_json, print_table
from cforge.config import get_settings
from cforge.profile_utils import (
AuthProfile,
ProfileStore,
get_active_profile,
get_all_profiles,
get_profile,
load_profile_store,
ProfileStore,
save_profile_store,
set_active_profile,
)
Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/settings/support_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Third-Party
import typer

# First-Party
# Local
from cforge.common.console import get_console


Expand Down
4 changes: 3 additions & 1 deletion cforge/commands/settings/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"""

# First-Party
from mcpgateway import __version__

# Local
from cforge.common.console import get_console
from cforge.common.http import make_authenticated_request
from mcpgateway import __version__


def version() -> None:
Expand Down
2 changes: 1 addition & 1 deletion cforge/commands/settings/whoami.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
CLI command: whoami
"""

# First-Party
# Local
from cforge.common.console import get_console
from cforge.common.http import get_token_file, load_token
from cforge.config import get_settings
Expand Down
2 changes: 2 additions & 0 deletions cforge/common/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
configuration without repeated construction.
"""

# Standard
from functools import lru_cache

# Third-Party
from rich.console import Console
import typer

Expand Down
Loading
Loading