Skip to content
Draft
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
2 changes: 0 additions & 2 deletions cloudsmith_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import warnings

import click
import urllib3

click.disable_unicode_literals_warning = True
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
warnings.filterwarnings("ignore", category=ResourceWarning)
10 changes: 9 additions & 1 deletion cloudsmith_cli/cli/tests/test_startup_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
import subprocess
import sys

HEAVY_PREFIXES = ("mcp", "httpx", "cloudsmith_api", "requests")
HEAVY_PREFIXES = (
"mcp",
"httpx",
"cloudsmith_api",
"requests",
"rich",
"urllib3",
"semver",
)


def modules_loaded_by_import(module_name="cloudsmith_cli.cli.commands.main"):
Expand Down
5 changes: 3 additions & 2 deletions cloudsmith_cli/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import click
from click_spinner import spinner
from rich.console import Console
from rich.table import Table

from ..core.api.version import get_version as get_api_version
from ..core.version import get_version as get_cli_version
Expand Down Expand Up @@ -74,6 +72,9 @@ def pretty_print_row(styled, plain):

def rich_print_table(headers, rows, title=None, show_lines=False):
"""Rich table from headers and rows."""
from rich.console import Console
from rich.table import Table

console = Console()
table = Table(title=title, show_lines=show_lines)

Expand Down
4 changes: 2 additions & 2 deletions cloudsmith_cli/core/api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import importlib.metadata

import semver


def get_version():
"""Get the raw/unparsed version of the API as a string."""
Expand All @@ -12,4 +10,6 @@ def get_version():

def get_version_info():
"""Get the API version as VersionInfo object."""
import semver

return semver.parse_version_info(get_version())
3 changes: 3 additions & 0 deletions cloudsmith_cli/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import time

import requests
import urllib3
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


class RetryWithCallback(Retry):
"""A urllib3 Retry with a callback on retries."""
Expand Down
4 changes: 2 additions & 2 deletions cloudsmith_cli/core/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Core version utilities."""

import semver

from . import utils


Expand All @@ -17,4 +15,6 @@ def get_version_info():

def parse_version(version):
"""Get a version string as a VersionInfo object."""
import semver

return semver.parse_version_info(version)
Loading