Skip to content

cli ¤

Module that contains the command line application.

Modules:

  • debug

    Debugging utilities.

Classes:

Functions:

  • main

    Run the main program.

  • print_and_exit

    Argument action callable to print something and exit immediately.

CommandCreate dataclass ¤

CommandCreate(
    *,
    help: bool = False,
    namespace: str,
    repo: str,
    description: str,
    repo_path: Path,
    insiders_repo_path: Path,
    insiders_namespace: str | None = None,
    insiders_repo: str | None = None,
    username: str | None = None,
    copier_template: str | None = None,
    register_pypi: bool = False
)

Bases: HelpOption

Command to create public/insiders repositories.

Attributes:

  • copier_template (str | None) –

    Copier template to initialize the local insiders repository with.

  • description (str) –

    Shared description.

  • help (bool) –

    Print the program help and exit.

  • insiders_namespace (str | None) –

    Namespace of the insiders repository. Defaults to the public namespace.

  • insiders_repo (str | None) –

    Name of the insiders repository. Defaults to the public name.

  • insiders_repo_path (Path) –

    Local path in which to clone the insiders repository.

  • namespace (str) –

    Namespace of the public repository.

  • register_pypi (bool) –

    Whether to register the project name on PyPI as version 0.0.0.

  • repo (str) –

    Name of the public repository.

  • repo_path (Path) –

    Local path in which to clone the public repository.

  • username (str | None) –

    Username. Defaults to the public namespace value.

copier_template class-attribute instance-attribute ¤

copier_template: str | None = None

Copier template to initialize the local insiders repository with.

description instance-attribute ¤

description: str

Shared description.

help class-attribute instance-attribute ¤

help: bool = False

Print the program help and exit.

insiders_namespace class-attribute instance-attribute ¤

insiders_namespace: str | None = None

Namespace of the insiders repository. Defaults to the public namespace.

insiders_repo class-attribute instance-attribute ¤

insiders_repo: str | None = None

Name of the insiders repository. Defaults to the public name.

insiders_repo_path instance-attribute ¤

insiders_repo_path: Path

Local path in which to clone the insiders repository.

namespace instance-attribute ¤

namespace: str

Namespace of the public repository.

register_pypi class-attribute instance-attribute ¤

register_pypi: bool = False

Whether to register the project name on PyPI as version 0.0.0.

repo instance-attribute ¤

repo: str

Name of the public repository.

repo_path instance-attribute ¤

repo_path: Path

Local path in which to clone the public repository.

username class-attribute instance-attribute ¤

username: str | None = None

Username. Defaults to the public namespace value.

CommandMain dataclass ¤

CommandMain(
    *,
    help: bool = False,
    subcommand: Subcommands[CommandCreate | CommandPyPI],
    version: bool = False,
    debug_info: bool = False,
    completion: bool = False
)

Bases: HelpOption

Command to manage your Insiders projects.

Attributes:

debug_info class-attribute instance-attribute ¤

debug_info: bool = False

Print debug information.

help class-attribute instance-attribute ¤

help: bool = False

Print the program help and exit.

subcommand instance-attribute ¤

subcommand: Subcommands[CommandCreate | CommandPyPI]

The selected subcommand.

CommandPyPI dataclass ¤

CommandPyPI(
    *,
    help: bool = False,
    subcommand: Subcommands[CommandPyPIRegister]
)

Bases: HelpOption

Command to manage PyPI-related things.

Attributes:

help class-attribute instance-attribute ¤

help: bool = False

Print the program help and exit.

subcommand instance-attribute ¤

subcommand: Subcommands[CommandPyPIRegister]

The selected subcommand.

CommandPyPIRegister dataclass ¤

CommandPyPIRegister(
    *,
    help: bool = False,
    username: str,
    name: str,
    description: str
)

Bases: HelpOption

Command to register a project name on PyPI.

Attributes:

description instance-attribute ¤

description: str

Description of the project on PyPI.

help class-attribute instance-attribute ¤

help: bool = False

Print the program help and exit.

name instance-attribute ¤

name: str

Name to register.

username instance-attribute ¤

username: str

Username on PyPI (your account).

HelpOption dataclass ¤

HelpOption(*, help: bool = False)

Reusable class to share a -h, --help option.

Attributes:

  • help (bool) –

    Print the program help and exit.

help class-attribute instance-attribute ¤

help: bool = False

Print the program help and exit.

main ¤

main(args: list[str] | None = None) -> int

Run the main program.

This function is executed when you type insiders or python -m insiders.

Parameters:

  • args (list[str] | None, default: None ) –

    Arguments passed from the command line.

Returns:

  • int

    An exit code.

print_and_exit ¤

print_and_exit(
    func: Callable[[], str | None], code: int = 0
) -> Callable[[], None]

Argument action callable to print something and exit immediately.

Parameters:

  • func (Callable[[], str | None]) –

    A function that returns or prints a string.

  • code (int, default: 0 ) –

    The status code to exit with.