Skip to content

cli ¤

Module that contains the command line application.

Modules:

  • repos

    CLI repos command.

  • server

    CLI server command.

  • update

    CLI update command.

  • watcher

    CLI watcher command.

Functions:

add_arg_conf_path ¤

add_arg_conf_path(parser: ArgumentParser) -> None

Add a conf-path option to the parser.

Parameters:

add_arg_dist_dir ¤

add_arg_dist_dir(parser: ArgumentParser) -> None

Add a dist-dir option to the parser.

Parameters:

add_arg_index_url ¤

add_arg_index_url(parser: ArgumentParser) -> None

Add an index-url option to the parser.

Parameters:

add_arg_log_level ¤

add_arg_log_level(parser: ArgumentParser) -> None

Add a log-level option to the parser.

Parameters:

add_arg_log_path ¤

add_arg_log_path(parser: ArgumentParser) -> None

Add a log-path option to the parser.

Parameters:

add_arg_port ¤

add_arg_port(parser: ArgumentParser) -> None

Add a port option to the parser.

Parameters:

add_arg_repo_dir ¤

add_arg_repo_dir(parser: ArgumentParser) -> None

Add a repo-dir option to the parser.

Parameters:

add_arg_repositories ¤

add_arg_repositories(
    parser: ArgumentParser, nargs: str = "+"
) -> None

Add a repository argument to the parser.

Parameters:

add_arg_repositories_packages ¤

add_arg_repositories_packages(
    parser: ArgumentParser,
) -> None

Add a repository:package argument to the parser.

Parameters:

add_arg_sleep ¤

add_arg_sleep(parser: ArgumentParser) -> None

Add a sleep option to the parser.

Parameters:

configure_logging ¤

configure_logging(
    level: str,
    path: str | Path | None = None,
    allow: str | tuple[str] | None = None,
) -> None

Configure logging.

Parameters:

  • level (str) –

    Log level (name).

  • path (str | Path | None, default: None ) –

    Log file path.

  • allow (str | tuple[str] | None, default: None ) –

    List of package names for which to allow log levels greater or equal to INFO level. Packages that are not allowed will see all their logs demoted to DEBUG level. If unspecified, allow everything.

get_parser ¤

get_parser() -> ArgumentParser

Return the CLI argument parser.

Returns:

main ¤

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

Run the main program.

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

Parameters:

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

    Arguments passed from the command line.

Returns:

  • int

    An exit code.

subparser ¤

subparser(
    parser: ArgumentParser,
    command: str,
    command_help: str,
    help_option_text: str,
    **kwargs: Any,
) -> ArgumentParser

Add a subparser to a parser.

Parameters:

  • parser (ArgumentParser) –

    The parser to add the subparser to.

  • command (str) –

    The subcommand invoking this subparser.

  • command_help (str) –

    The subcommand description.

  • help_option_text (str) –

    The message of the subcommand's -h option.

  • **kwargs (Any, default: {} ) –

    Additional parameters passed to add_parser.

Returns: