cli ¤
Module that contains the command line application.
Classes:
-
CommandCreate
–Command to create public/insiders repositories.
-
CommandMain
–Command to manage your Insiders projects.
-
CommandPyPI
–Command to manage PyPI-related things.
-
CommandPyPIRegister
–Command to register a project name on PyPI.
-
HelpOption
–Reusable class to share a
-h
,--help
option.
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
)
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.
-
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.
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.
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
(bool
) –Print debug information.
-
help
(bool
) –Print the program help and exit.
-
subcommand
(Subcommands[CommandCreate | CommandPyPI]
) –The selected subcommand.
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
(bool
) –Print the program help and exit.
-
subcommand
(Subcommands[CommandPyPIRegister]
) –The selected subcommand.
subcommand instance-attribute
¤
subcommand: Subcommands[CommandPyPIRegister]
The selected subcommand.
CommandPyPIRegister dataclass
¤
Bases: HelpOption
Command to register a project name on PyPI.
Attributes:
-
description
(str
) –Description of the project on PyPI.
-
help
(bool
) –Print the program help and exit.
-
name
(str
) –Name to register.
-
username
(str
) –Username on PyPI (your account).
main ¤
Run the main program.
This function is executed when you type insiders
or python -m insiders
.
Parameters:
Returns:
-
int
–An exit code.
Source code in src/insiders/cli.py
300 301 302 303 304 305 306 307 308 |
|
print_and_exit ¤
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.
Source code in src/insiders/cli.py
29 30 31 32 33 34 35 36 37 38 39 |
|