cli ¤
Module that contains the command line application.
Classes:
-
CommandBacklog
–Command to list the backlog of issues.
-
CommandIndex
–Command to manage the local index.
-
CommandIndexAdd
–Command to add a repository to the watched repositories.
-
CommandIndexList
–Command to list the watched repositories.
-
CommandIndexLogs
–Command to show the server logs.
-
CommandIndexRemove
–Command to remove a repository and its distributions (if served locally).
-
CommandIndexStart
–Command to start the server.
-
CommandIndexStatus
–Command to show the server status.
-
CommandIndexStop
–Command to stop the server.
-
CommandIndexUpdate
–Command to update watched projects.
-
CommandMain
–Command to manage your Insiders projects.
-
CommandProject
–Command to manage projects on GitHub and locally.
-
CommandProjectCheck
–Command to check GitHub projects.
-
CommandProjectCreate
–Command to create public/insiders repositories.
-
CommandProjectPyPIRegister
–Command to register a project name on PyPI.
-
CommandSponsors
–Command to manage sponsors.
-
CommandSponsorsList
–Command to list sponsors.
-
CommandSponsorsShow
–Command to show details about a sponsor/user.
-
CommandSponsorsTeamList
–Command to list team memberships.
-
CommandSponsorsTeamSync
–Command to sync team memberships with current sponsors.
-
FromConfig
–
Functions:
-
main
–Run the main program.
CommandBacklog dataclass
¤
CommandBacklog(
*,
backlog_namespaces: list[str],
issue_labels: dict[str, str] = dict(),
limit: int = 0,
sort: list[Callable] = list(),
public: bool = False,
polar_token: str = "",
polar_beneficiaries: dict[str, list[str]] = dict(),
github_token: str = "",
github_beneficiaries: dict[str, list[str]] = dict()
)
Command to list the backlog of issues.
Attributes:
-
backlog_namespaces
(list[str]
) –Namespaces to fetch issues from.
-
github_beneficiaries
(dict[str, list[str]]
) –Beneficiaries of GitHub sponsors.
-
github_token
(str
) –A GitHub token. Recommended scopes:
read:user
. -
issue_labels
(dict[str, str]
) –Issue labels to keep in issues metadata, and how they are represented.
-
limit
(int
) –Limit the number of issues to display.
-
polar_beneficiaries
(dict[str, list[str]]
) –Beneficiaries of Polar sponsors.
-
polar_token
(str
) –A Polar token. Recommended scopes:
user:read
,issues:read
,subscriptions:read
. -
public
(bool
) –Only use public sponsorships.
-
sort
(list[Callable]
) –Sort strategy.
backlog_namespaces instance-attribute
¤
Namespaces to fetch issues from.
github_beneficiaries class-attribute
instance-attribute
¤
Beneficiaries of GitHub sponsors.
github_token class-attribute
instance-attribute
¤
github_token: str = ''
A GitHub token. Recommended scopes: read:user
.
issue_labels class-attribute
instance-attribute
¤
Issue labels to keep in issues metadata, and how they are represented.
polar_beneficiaries class-attribute
instance-attribute
¤
Beneficiaries of Polar sponsors.
CommandIndex dataclass
¤
CommandIndex(
*,
subcommand: (
CommandIndexList
| CommandIndexAdd
| CommandIndexRemove
| CommandIndexUpdate
| CommandIndexStart
| CommandIndexStatus
| CommandIndexStop
| CommandIndexLogs
)
)
Command to manage the local index.
Attributes:
-
subcommand
(CommandIndexList | CommandIndexAdd | CommandIndexRemove | CommandIndexUpdate | CommandIndexStart | CommandIndexStatus | CommandIndexStop | CommandIndexLogs
) –The selected subcommand.
subcommand instance-attribute
¤
subcommand: (
CommandIndexList
| CommandIndexAdd
| CommandIndexRemove
| CommandIndexUpdate
| CommandIndexStart
| CommandIndexStatus
| CommandIndexStop
| CommandIndexLogs
)
The selected subcommand.
CommandIndexAdd dataclass
¤
CommandIndexAdd(
*,
repositories: list[str],
sources_directory: Path = DEFAULT_REPO_DIR,
distributions_directory: Path = DEFAULT_DIST_DIR,
url: str = DEFAULT_INDEX_URL
)
Command to add a repository to the watched repositories.
Attributes:
-
distributions_directory
(Path
) –Directory where the distributions are stored.
-
repositories
(list[str]
) –List of repositories (GitHub namespace/project or Git URL git@host:repo).
-
sources_directory
(Path
) –Directory where the sources are stored.
-
url
(str
) –URL of the index to upload packages to.
distributions_directory class-attribute
instance-attribute
¤
distributions_directory: Path = DEFAULT_DIST_DIR
Directory where the distributions are stored.
repositories instance-attribute
¤
List of repositories (GitHub namespace/project or Git URL git@host:repo).
CommandIndexList dataclass
¤
CommandIndexList(
*,
sources_directory: Path = DEFAULT_REPO_DIR,
distributions_directory: Path = DEFAULT_DIST_DIR,
dists: bool = False,
projects: bool = False
)
Command to list the watched repositories.
Attributes:
-
distributions_directory
(Path
) –Directory where the distributions are stored.
-
dists
(bool
) –List distributions.
-
projects
(bool
) –List projects.
-
sources_directory
(Path
) –Directory where the sources are stored.
CommandIndexRemove dataclass
¤
CommandIndexRemove(
*,
repositories: list[str],
sources_directory: Path = DEFAULT_REPO_DIR,
distributions_directory: Path = DEFAULT_DIST_DIR
)
Command to remove a repository and its distributions (if served locally).
Attributes:
-
distributions_directory
(Path
) –Directory where the distributions are stored.
-
repositories
(list[str]
) –List of repository names.
-
sources_directory
(Path
) –Directory where the sources are stored.
CommandIndexStart dataclass
¤
CommandIndexStart(
*,
sources_directory: Path = DEFAULT_REPO_DIR,
distributions_directory: Path = DEFAULT_DIST_DIR,
url: str = DEFAULT_INDEX_URL,
background: bool = False,
log_path: str | None = None
)
Command to start the server.
Attributes:
-
background
(bool
) –Run the server in the background.
-
distributions_directory
(Path
) –Directory where the distributions are stored.
-
log_path
(str | None
) –Where to write index server logs.
-
sources_directory
(Path
) –Directory where the sources are stored.
-
url
(str
) –URL to serve the index at.
background class-attribute
instance-attribute
¤
background: bool = False
Run the server in the background.
distributions_directory class-attribute
instance-attribute
¤
distributions_directory: Path = DEFAULT_DIST_DIR
Directory where the distributions are stored.
log_path class-attribute
instance-attribute
¤
log_path: str | None = None
Where to write index server logs.
CommandIndexUpdate dataclass
¤
CommandIndexUpdate(
*,
repositories: list[str] = list(),
sources_directory: Path = DEFAULT_REPO_DIR,
distributions_directory: Path = DEFAULT_DIST_DIR,
url: str = DEFAULT_INDEX_URL
)
Command to update watched projects.
Attributes:
-
distributions_directory
(Path
) –Directory where the distributions are stored.
-
repositories
(list[str]
) –List of repository names.
-
sources_directory
(Path
) –Directory where the sources are stored.
-
url
(str
) –URL of the index to upload packages to.
distributions_directory class-attribute
instance-attribute
¤
distributions_directory: Path = DEFAULT_DIST_DIR
Directory where the distributions are stored.
repositories class-attribute
instance-attribute
¤
List of repository names.
CommandMain dataclass
¤
CommandMain(
*,
subcommand: (
CommandBacklog
| CommandIndex
| CommandProject
| CommandSponsors
),
version: bool = False,
debug_info: bool = False,
config: Config = _load_config(),
log_level: Literal[
"TRACE",
"DEBUG",
"INFO",
"SUCCESS",
"WARNING",
"ERROR",
"CRITICAL",
] = "INFO",
log_path: str | None = None,
log_include: tuple[str, ...] = tuple(),
log_exclude: tuple[str, ...] = tuple(),
log_downgrade: tuple[str, ...] = tuple()
)
Command to manage your Insiders projects.
Attributes:
-
config
(Config
) –Path to the configuration file.
-
debug_info
(bool
) –Print debug information.
-
log_downgrade
(tuple[str, ...]
) –Downgrade INFO logs to DEBUG for logs originating from these modules/loggers. By default, all dependency logs are downgraded.
-
log_exclude
(tuple[str, ...]
) –Exclude logs originating from these modules/loggers. Applied after inclusion. By default, nothing is excluded.
-
log_include
(tuple[str, ...]
) –Include logs originating from these modules/loggers. By default, all logs are included.
-
log_level
(Literal['TRACE', 'DEBUG', 'INFO', 'SUCCESS', 'WARNING', 'ERROR', 'CRITICAL']
) –Lowest log level to display. Levels below that will be hidden.
-
log_path
(str | None
) –Write log messages to this file path.
-
subcommand
(CommandBacklog | CommandIndex | CommandProject | CommandSponsors
) –The selected subcommand.
-
version
(bool
) –Print the program version and exit.
config class-attribute
instance-attribute
¤
Path to the configuration file.
log_downgrade class-attribute
instance-attribute
¤
Downgrade INFO logs to DEBUG for logs originating from these modules/loggers. By default, all dependency logs are downgraded.
log_exclude class-attribute
instance-attribute
¤
Exclude logs originating from these modules/loggers. Applied after inclusion. By default, nothing is excluded.
log_include class-attribute
instance-attribute
¤
Include logs originating from these modules/loggers. By default, all logs are included.
log_level class-attribute
instance-attribute
¤
log_level: Literal[
"TRACE",
"DEBUG",
"INFO",
"SUCCESS",
"WARNING",
"ERROR",
"CRITICAL",
] = "INFO"
Lowest log level to display. Levels below that will be hidden.
log_path class-attribute
instance-attribute
¤
log_path: str | None = None
Write log messages to this file path.
subcommand instance-attribute
¤
subcommand: (
CommandBacklog
| CommandIndex
| CommandProject
| CommandSponsors
)
The selected subcommand.
CommandProject dataclass
¤
CommandProject(
*,
subcommand: (
CommandProjectCreate
| CommandProjectCheck
| CommandProjectPyPIRegister
)
)
Command to manage projects on GitHub and locally.
Attributes:
-
subcommand
(CommandProjectCreate | CommandProjectCheck | CommandProjectPyPIRegister
) –The selected subcommand.
subcommand instance-attribute
¤
subcommand: (
CommandProjectCreate
| CommandProjectCheck
| CommandProjectPyPIRegister
)
The selected subcommand.
CommandProjectCreate dataclass
¤
CommandProjectCreate(
*,
repository: str,
description: str,
namespace: str,
project_directory: Path,
insiders_repository: str | None = None,
insiders_namespace: str | None = None,
insiders_project_directory: Path,
github_username: str | None = None,
copier_template: str | None = None,
copier_template_answers: dict[str, str] | None = None,
post_creation_command: list[str] | None = None,
register_on_pypi: bool = False,
pypi_username: str | None = None
)
Command to create public/insiders repositories.
Attributes:
-
copier_template
(str | None
) –Copier template to generate new projects with.
-
copier_template_answers
(dict[str, str] | None
) –Copier template answers to use when generating a project.
-
description
(str
) –Shared description.
-
github_username
(str | None
) –GitHub username.
-
insiders_namespace
(str | None
) –Namespace of the insiders repository.
-
insiders_project_directory
(Path
) –Directory in which to clone the insiders repository.
-
insiders_repository
(str | None
) –Name of the insiders repository.
-
namespace
(str
) –Namespace of the public repository.
-
post_creation_command
(list[str] | None
) –Command to run after creating the public repository.
-
project_directory
(Path
) –Directory in which to clone the public repository.
-
pypi_username
(str | None
) –PyPI username to register the project with.
-
register_on_pypi
(bool
) –Whether to register the project on PyPI after creating it.
-
repository
(str
) –Name of the public repository.
copier_template class-attribute
instance-attribute
¤
copier_template: str | None = None
Copier template to generate new projects with.
copier_template_answers class-attribute
instance-attribute
¤
Copier template answers to use when generating a project.
github_username class-attribute
instance-attribute
¤
github_username: str | None = None
GitHub username.
insiders_namespace class-attribute
instance-attribute
¤
insiders_namespace: str | None = None
Namespace of the insiders repository.
insiders_project_directory instance-attribute
¤
insiders_project_directory: Path
Directory in which to clone the insiders repository.
insiders_repository class-attribute
instance-attribute
¤
insiders_repository: str | None = None
Name of the insiders repository.
post_creation_command class-attribute
instance-attribute
¤
Command to run after creating the public repository.
project_directory instance-attribute
¤
project_directory: Path
Directory in which to clone the public repository.
pypi_username class-attribute
instance-attribute
¤
pypi_username: str | None = None
PyPI username to register the project with.
CommandProjectPyPIRegister dataclass
¤
Command to register a project name on PyPI.
Attributes:
CommandSponsors dataclass
¤
CommandSponsors(
*,
subcommand: (
CommandSponsorsList
| CommandSponsorsShow
| CommandSponsorsTeamList
| CommandSponsorsTeamSync
)
)
Command to manage sponsors.
Attributes:
-
subcommand
(CommandSponsorsList | CommandSponsorsShow | CommandSponsorsTeamList | CommandSponsorsTeamSync
) –The selected subcommand.
subcommand instance-attribute
¤
subcommand: (
CommandSponsorsList
| CommandSponsorsShow
| CommandSponsorsTeamList
| CommandSponsorsTeamSync
)
The selected subcommand.
CommandSponsorsList dataclass
¤
CommandSponsorsList(
*,
github_sponsored_account: str = "",
include_users: list[str] = list(),
exclude_users: list[str] = list(),
github_beneficiaries: dict[str, list[str]] = dict(),
github_token: str = "",
polar_sponsored_account: str = "",
polar_beneficiaries: dict[str, list[str]] = dict(),
polar_token: str = "",
minimum_amount: int = 0,
public: bool = False,
sponsorships: bool = False
)
Command to list sponsors.
Attributes:
-
exclude_users
(list[str]
) –Users that should never be in the team.
-
github_beneficiaries
(dict[str, list[str]]
) –Beneficiaries of GitHub sponsors.
-
github_sponsored_account
(str
) –The sponsored account on GitHub Sponsors.
-
github_token
(str
) –A GitHub token. Recommended scopes:
admin:org
andread:user
. -
include_users
(list[str]
) –Users that should always be in the team.
-
minimum_amount
(int
) –Minimum amount to be considered an insider.
-
polar_beneficiaries
(dict[str, list[str]]
) –Beneficiaries of Polar sponsors.
-
polar_sponsored_account
(str
) –The sponsored account on Polar.
-
polar_token
(str
) –A Polar token. Recommended scopes:
user:read
,issues:read
,subscriptions:read
. -
public
(bool
) –Only use public sponsorships.
-
sponsorships
(bool
) –List sponsorships rather than users/sponsors.
exclude_users class-attribute
instance-attribute
¤
Users that should never be in the team.
github_beneficiaries class-attribute
instance-attribute
¤
Beneficiaries of GitHub sponsors.
github_sponsored_account class-attribute
instance-attribute
¤
github_sponsored_account: str = ''
The sponsored account on GitHub Sponsors.
github_token class-attribute
instance-attribute
¤
github_token: str = ''
A GitHub token. Recommended scopes: admin:org
and read:user
.
include_users class-attribute
instance-attribute
¤
Users that should always be in the team.
minimum_amount class-attribute
instance-attribute
¤
minimum_amount: int = 0
Minimum amount to be considered an insider.
polar_beneficiaries class-attribute
instance-attribute
¤
Beneficiaries of Polar sponsors.
polar_sponsored_account class-attribute
instance-attribute
¤
polar_sponsored_account: str = ''
The sponsored account on Polar.
CommandSponsorsShow dataclass
¤
CommandSponsorsShow(
*,
insiders_team: str,
github_sponsored_account: str = "",
include_users: list[str] = list(),
exclude_users: list[str] = list(),
github_beneficiaries: dict[str, list[str]] = dict(),
github_token: str = "",
polar_sponsored_account: str = "",
polar_token: str = "",
minimum_amount: int = 0,
dry_run: bool = False
)
Command to show details about a sponsor/user.
Attributes:
-
dry_run
(bool
) –Display the changes that would be made, without making them.
-
exclude_users
(list[str]
) –Users that should never be in the team.
-
github_beneficiaries
(dict[str, list[str]]
) –A mapping of users belonging to sponsoring organizations.
-
github_sponsored_account
(str
) –The sponsored account on GitHub Sponsors.
-
github_token
(str
) –A GitHub token. Recommended scopes:
admin:org
andread:user
. -
include_users
(list[str]
) –Users that should always be in the team.
-
insiders_team
(str
) –The GitHub team to sync.
-
minimum_amount
(int
) –Minimum amount to be considered an insider.
-
polar_sponsored_account
(str
) –The sponsored account on Polar.
-
polar_token
(str
) –A Polar token. Recommended scopes:
user:read
,issues:read
,subscriptions:read
.
dry_run class-attribute
instance-attribute
¤
dry_run: bool = False
Display the changes that would be made, without making them.
exclude_users class-attribute
instance-attribute
¤
Users that should never be in the team.
github_beneficiaries class-attribute
instance-attribute
¤
A mapping of users belonging to sponsoring organizations.
github_sponsored_account class-attribute
instance-attribute
¤
github_sponsored_account: str = ''
The sponsored account on GitHub Sponsors.
github_token class-attribute
instance-attribute
¤
github_token: str = ''
A GitHub token. Recommended scopes: admin:org
and read:user
.
include_users class-attribute
instance-attribute
¤
Users that should always be in the team.
minimum_amount class-attribute
instance-attribute
¤
minimum_amount: int = 0
Minimum amount to be considered an insider.
CommandSponsorsTeamSync dataclass
¤
CommandSponsorsTeamSync(
*,
insiders_team: str,
github_sponsored_account: str = "",
include_users: list[str] = list(),
exclude_users: list[str] = list(),
github_beneficiaries: dict[str, list[str]] = dict(),
github_token: str = "",
polar_sponsored_account: str = "",
polar_beneficiaries: dict[str, list[str]] = dict(),
polar_token: str = "",
minimum_amount: int = 0,
dry_run: bool = False
)
Command to sync team memberships with current sponsors.
Attributes:
-
dry_run
(bool
) –Display the changes that would be made, without making them.
-
exclude_users
(list[str]
) –Users that should never be in the team.
-
github_beneficiaries
(dict[str, list[str]]
) –A mapping of users belonging to sponsoring organizations.
-
github_sponsored_account
(str
) –The sponsored account on GitHub Sponsors.
-
github_token
(str
) –A GitHub token. Recommended scopes:
admin:org
andread:user
. -
include_users
(list[str]
) –Users that should always be in the team.
-
insiders_team
(str
) –The GitHub team to sync.
-
minimum_amount
(int
) –Minimum amount to be considered an insider.
-
polar_beneficiaries
(dict[str, list[str]]
) –Beneficiaries of Polar sponsors.
-
polar_sponsored_account
(str
) –The sponsored account on Polar.
-
polar_token
(str
) –A Polar token. Recommended scopes:
user:read
,issues:read
,subscriptions:read
.
dry_run class-attribute
instance-attribute
¤
dry_run: bool = False
Display the changes that would be made, without making them.
exclude_users class-attribute
instance-attribute
¤
Users that should never be in the team.
github_beneficiaries class-attribute
instance-attribute
¤
A mapping of users belonging to sponsoring organizations.
github_sponsored_account class-attribute
instance-attribute
¤
github_sponsored_account: str = ''
The sponsored account on GitHub Sponsors.
github_token class-attribute
instance-attribute
¤
github_token: str = ''
A GitHub token. Recommended scopes: admin:org
and read:user
.
include_users class-attribute
instance-attribute
¤
Users that should always be in the team.
minimum_amount class-attribute
instance-attribute
¤
minimum_amount: int = 0
Minimum amount to be considered an insider.
polar_beneficiaries class-attribute
instance-attribute
¤
Beneficiaries of Polar sponsors.