Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 15, 2024
1 parent dafd282 commit fd0d1ec
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 238 deletions.
7 changes: 4 additions & 3 deletions mknodes/basenodes/mkclidoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

from mknodes.templatenodes import mktemplate
from mknodes.utils import log
from mknodes.info.cli import clihelpers, commandinfo

import clinspector

if TYPE_CHECKING:
import argparse
Expand Down Expand Up @@ -42,7 +43,7 @@ def __init__(
self.show_subcommands = show_subcommands

@property
def info(self) -> commandinfo.CommandInfo | None:
def info(self) -> clinspector.CommandInfo | None:
import importlib

match self.target:
Expand All @@ -62,7 +63,7 @@ def info(self) -> commandinfo.CommandInfo | None:
case _:
instance = self.target
prog_name = self.prog_name
return clihelpers.get_cli_info(instance, command=prog_name)
return clinspector.get_cmd_info(instance, command=prog_name)


if __name__ == "__main__":
Expand Down
Empty file removed mknodes/info/cli/__init__.py
Empty file.
117 changes: 0 additions & 117 deletions mknodes/info/cli/clihelpers.py

This file was deleted.

43 changes: 0 additions & 43 deletions mknodes/info/cli/commandinfo.py

This file was deleted.

69 changes: 0 additions & 69 deletions mknodes/info/cli/param.py

This file was deleted.

5 changes: 2 additions & 3 deletions mknodes/info/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
import datetime
import types

import clinspector
from griffe import Alias, Module

from mknodes.info.cli import commandinfo


logger = log.get_logger(__name__)

Expand Down Expand Up @@ -211,7 +210,7 @@ class PackageContext(Context):
"""A dictionary containing the entry points of the distribution."""
cli: str | None = None
"""The cli package name used by the distribution."""
cli_info: commandinfo.CommandInfo | None = None
cli_info: clinspector.CommandInfo | None = None
"""An object containing information about all cli commands."""

# required_packages: dict[PackageInfo, packagehelpers.Dependency] =
Expand Down
6 changes: 3 additions & 3 deletions mknodes/info/packageinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from importlib import metadata
from typing import Any

import clinspector
import epregistry
from requests import structures

from mknodes.info.cli import clihelpers, commandinfo
from mknodes.utils import log, packagehelpers, reprhelpers


Expand Down Expand Up @@ -202,13 +202,13 @@ def cli(self) -> str | None:
return None

@functools.cached_property
def cli_info(self) -> commandinfo.CommandInfo | None:
def cli_info(self) -> clinspector.CommandInfo | None:
"""Return a CLI info object containing infos about all CLI commands / options."""
if eps := self.entry_points.get_group("console_scripts"):
ep = eps[0].load()
qual_name = ep.__class__.__module__.lower()
if qual_name.startswith(("typer", "click")):
return clihelpers.get_cli_info(ep)
return clinspector.get_cmd_info(ep)
return None

@functools.cached_property
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dependencies = [
"git-changelog",
"mkdocstrings[python]",
"epregistry",
"clinspector",
]
license = { file = "LICENSE" }

Expand Down

0 comments on commit fd0d1ec

Please sign in to comment.