Skip to content

cli ¤

Module that contains the command line application.

Classes:

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 instance-attribute ¤

backlog_namespaces: list[str]

Namespaces to fetch issues from.

github_beneficiaries class-attribute instance-attribute ¤

github_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

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: dict[str, str] = field(default_factory=dict)

Issue labels to keep in issues metadata, and how they are represented.

limit class-attribute instance-attribute ¤

limit: int = 0

Limit the number of issues to display.

polar_beneficiaries class-attribute instance-attribute ¤

polar_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

Beneficiaries of Polar sponsors.

polar_token class-attribute instance-attribute ¤

polar_token: str = ''

A Polar token. Recommended scopes: user:read, issues:read, subscriptions:read.

public class-attribute instance-attribute ¤

public: bool = False

Only use public sponsorships.

sort class-attribute instance-attribute ¤

sort: list[Callable] = field(default_factory=list)

Sort strategy.

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 class-attribute instance-attribute ¤

distributions_directory: Path = DEFAULT_DIST_DIR

Directory where the distributions are stored.

repositories instance-attribute ¤

repositories: list[str]

List of repositories (GitHub namespace/project or Git URL git@host:repo).

sources_directory class-attribute instance-attribute ¤

sources_directory: Path = DEFAULT_REPO_DIR

Directory where the sources are stored.

url class-attribute instance-attribute ¤

url: str = DEFAULT_INDEX_URL

URL of the index to upload packages to.

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 class-attribute instance-attribute ¤

distributions_directory: Path = DEFAULT_DIST_DIR

Directory where the distributions are stored.

dists class-attribute instance-attribute ¤

dists: bool = False

List distributions.

projects class-attribute instance-attribute ¤

projects: bool = False

List projects.

sources_directory class-attribute instance-attribute ¤

sources_directory: Path = DEFAULT_REPO_DIR

Directory where the sources are stored.

CommandIndexLogs dataclass ¤

CommandIndexLogs()

Command to show the server logs.

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 class-attribute instance-attribute ¤

distributions_directory: Path = DEFAULT_DIST_DIR

Directory where the distributions are stored.

repositories instance-attribute ¤

repositories: list[str]

List of repository names.

sources_directory class-attribute instance-attribute ¤

sources_directory: Path = DEFAULT_REPO_DIR

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 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.

sources_directory class-attribute instance-attribute ¤

sources_directory: Path = DEFAULT_REPO_DIR

Directory where the sources are stored.

url class-attribute instance-attribute ¤

url: str = DEFAULT_INDEX_URL

URL to serve the index at.

CommandIndexStatus dataclass ¤

CommandIndexStatus()

Command to show the server status.

CommandIndexStop dataclass ¤

CommandIndexStop()

Command to stop the server.

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 class-attribute instance-attribute ¤

distributions_directory: Path = DEFAULT_DIST_DIR

Directory where the distributions are stored.

repositories class-attribute instance-attribute ¤

repositories: list[str] = field(default_factory=list)

List of repository names.

sources_directory class-attribute instance-attribute ¤

sources_directory: Path = DEFAULT_REPO_DIR

Directory where the sources are stored.

url class-attribute instance-attribute ¤

url: str = DEFAULT_INDEX_URL

URL of the index to upload packages to.

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 class-attribute instance-attribute ¤

config: Config = field(default_factory=_load_config)

Path to the configuration file.

debug_info class-attribute instance-attribute ¤

debug_info: bool = False

Print debug information.

log_downgrade class-attribute instance-attribute ¤

log_downgrade: tuple[str, ...] = field(
    default_factory=tuple
)

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 ¤

log_exclude: tuple[str, ...] = field(default_factory=tuple)

Exclude logs originating from these modules/loggers. Applied after inclusion. By default, nothing is excluded.

log_include class-attribute instance-attribute ¤

log_include: tuple[str, ...] = field(default_factory=tuple)

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 ¤

The selected subcommand.

version class-attribute instance-attribute ¤

version: bool = False

Print the program version and exit.

CommandProject dataclass ¤

CommandProject(
    *,
    subcommand: (
        CommandProjectCreate
        | CommandProjectCheck
        | CommandProjectPyPIRegister
    )
)

Command to manage projects on GitHub and locally.

Attributes:

subcommand instance-attribute ¤

The selected subcommand.

CommandProjectCheck dataclass ¤

CommandProjectCheck()

Command to check GitHub projects.

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 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: dict[str, str] | None = None

Copier template answers to use when generating a project.

description instance-attribute ¤

description: str

Shared description.

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.

namespace instance-attribute ¤

namespace: str

Namespace of the public repository.

post_creation_command class-attribute instance-attribute ¤

post_creation_command: list[str] | None = None

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.

register_on_pypi class-attribute instance-attribute ¤

register_on_pypi: bool = False

Whether to register the project on PyPI after creating it.

repository instance-attribute ¤

repository: str

Name of the public repository.

CommandProjectPyPIRegister dataclass ¤

CommandProjectPyPIRegister(
    *, username: str, name: str, description: str
)

Command to register a project name on PyPI.

Attributes:

description instance-attribute ¤

description: str

Description of the project on PyPI.

name instance-attribute ¤

name: str

Name to register.

username instance-attribute ¤

username: str

Username on PyPI (your account).

CommandSponsors dataclass ¤

Command to manage sponsors.

Attributes:

subcommand instance-attribute ¤

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 class-attribute instance-attribute ¤

exclude_users: list[str] = field(default_factory=list)

Users that should never be in the team.

github_beneficiaries class-attribute instance-attribute ¤

github_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

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 ¤

include_users: list[str] = field(default_factory=list)

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 ¤

polar_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

Beneficiaries of Polar sponsors.

polar_sponsored_account class-attribute instance-attribute ¤

polar_sponsored_account: str = ''

The sponsored account on Polar.

polar_token class-attribute instance-attribute ¤

polar_token: str = ''

A Polar token. Recommended scopes: user:read, issues:read, subscriptions:read.

public class-attribute instance-attribute ¤

public: bool = False

Only use public sponsorships.

sponsorships class-attribute instance-attribute ¤

sponsorships: bool = False

List sponsorships rather than users/sponsors.

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 class-attribute instance-attribute ¤

dry_run: bool = False

Display the changes that would be made, without making them.

exclude_users class-attribute instance-attribute ¤

exclude_users: list[str] = field(default_factory=list)

Users that should never be in the team.

github_beneficiaries class-attribute instance-attribute ¤

github_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

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 ¤

include_users: list[str] = field(default_factory=list)

Users that should always be in the team.

insiders_team instance-attribute ¤

insiders_team: str

The GitHub team to sync.

minimum_amount class-attribute instance-attribute ¤

minimum_amount: int = 0

Minimum amount to be considered an insider.

polar_sponsored_account class-attribute instance-attribute ¤

polar_sponsored_account: str = ''

The sponsored account on Polar.

polar_token class-attribute instance-attribute ¤

polar_token: str = ''

A Polar token. Recommended scopes: user:read, issues:read, subscriptions:read.

CommandSponsorsTeamList dataclass ¤

CommandSponsorsTeamList()

Command to list team memberships.

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 class-attribute instance-attribute ¤

dry_run: bool = False

Display the changes that would be made, without making them.

exclude_users class-attribute instance-attribute ¤

exclude_users: list[str] = field(default_factory=list)

Users that should never be in the team.

github_beneficiaries class-attribute instance-attribute ¤

github_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

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 ¤

include_users: list[str] = field(default_factory=list)

Users that should always be in the team.

insiders_team instance-attribute ¤

insiders_team: str

The GitHub team to sync.

minimum_amount class-attribute instance-attribute ¤

minimum_amount: int = 0

Minimum amount to be considered an insider.

polar_beneficiaries class-attribute instance-attribute ¤

polar_beneficiaries: dict[str, list[str]] = field(
    default_factory=dict
)

Beneficiaries of Polar sponsors.

polar_sponsored_account class-attribute instance-attribute ¤

polar_sponsored_account: str = ''

The sponsored account on Polar.

polar_token class-attribute instance-attribute ¤

polar_token: str = ''

A Polar token. Recommended scopes: user:read, issues:read, subscriptions:read.

FromConfig dataclass ¤

FromConfig(field: Unset | property)

Bases: ValueFrom

Parameters:

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.