prometa.gitlab package

Submodules

prometa.gitlab.ci module

Update the CI file.

class prometa.gitlab.ci.GitlabCI(project, path='.gitlab-ci.yml')[source]

Bases: object

Wrapper around the gitlab-ci file.

__init__(project, path='.gitlab-ci.yml')[source]
Parameters:
  • project – A Project instance.

  • path – The path to the gitlab-ci file, relative to the repository root directory.

add_register_pip_pkg()[source]

Add a jot to register a pip package.

add_release_job()[source]

Add a release job that triggers when Git tags are pushed.

add_stages()[source]

Add the list of stages for all added jobs.

add_tags()[source]

Add runner tags. This will deduplicate tags and also ensure that jobs using the same tags reference each other in the YAML output.

property data[source]

The CI configuration data.

load()[source]

Load the file data.

Returns:

The loaded data, or an empty dict if the file does not exist.

manage_hooks()[source]

Add or remove hooks depending on the current repository configuration.

update()[source]

Update the CI file by detecting which jobs should be added.

update_pages()[source]

Update the pages job.

prometa.gitlab.repo module

Git functions.

class prometa.gitlab.repo.GitlabRepo(path, remote='origin')[source]

Bases: object

Basic functionality for retrieving Git information.

__init__(path, remote='origin')[source]
Parameters:
  • path – A path to the Git repository or any non-submodule path within it.

  • remote – The remote repository name to use for generating URLs.

get_gitlab_project(glab)[source]

Get the python-gitlab Project instance from a python-gitlab GitLab instance.

get_main_blob_url(path)[source]

Get the main branch URL to the given path.

get_section_url(section)[source]

The URL to one of the various GitLab sections, e.g. “blob/main” or “packages”.

property parsed_origin[source]

A 3-tuple of the origin’s host, namespace and project name.

property public_git_url[source]

The publically accessible HTTPS URL.

property public_url[source]

The URL for the main project page.

property readme_url[source]

The URL to the README.

property remote_url[source]

The origin URL.

run_cmd(cmd)[source]

Run a git command and return its output.

Parameters:

cmd – The git sub-command and arguments.

Returns:

The command output.

property top_level[source]

The top-level directory.

Module contents

Package stub.