prometa.git.gitlab package

Subpackages

Submodules

prometa.git.gitlab.api module

Wrapper around python-gitlab functionality.

class prometa.git.gitlab.api.GitLabAPI(host)[source]

Bases: ExitStack, GitLabBadgesMixin, GitLabHooksMixin

Wrapper around GitLab API via python-gitlab.

__init__(host)[source]
Parameters:

host – A GitLabHost instance.

property gitlab[source]

The python-gitlab GitLab instance. It is only be accessible within this class’s context.

property gitlab_config[source]

The gitlab of the project configuration file.

property gitlab_project[source]

The python-gitlab Project instance.

manage()[source]

Update the repository via API calls.

manage_description()[source]

Manage the description. It will be taken from the first Package instance.

manage_merge_method()[source]

Manage the merge method.

manage_protected_branches()[source]

Manage protected branches as per the configuration file.

manage_protected_tags()[source]

Manage protected tags as per the configuration file.

property project[source]

The Project instance or subclass.

prometa.git.gitlab.api.get_access_level(value)[source]

Get the access level from a user-supplied value.

Parameters:

value – A case-insensitive string corresponding to an access level constant in AccessLevel or an integer access level. If the value is None or unrecognized, the maintainer access level is returned.

Returns:

The integer access level.

prometa.git.gitlab.host module

Functionality for GitLab hosts.

class prometa.git.gitlab.host.GitLabHost(project)[source]

Bases: GitHost

Functionality for GitLab hosts.

property gitlab_api[source]

The GitLabAPI instance.

property gitlab_ci[source]

The GitLabCI instance.

property is_used[source]

Check if the configuration indicates that this project uses this host.

Parameters:

project – A Project instance.

Returns:

True if the project is configured to use this host, else False.

property main_branches[source]

The main branches to which to restrict some configurations such as CI jobs via the “only” parameter.

update()[source]

Update the host via metadata files and/or API calls. This should handle CI, hooks, badges, etc.

property urls[source]

A dict of URLs specific to this host.

Module contents

Package stub.