prometa.git.gitlab.badges package
Subpackages
- prometa.git.gitlab.badges.python package
- Submodules
- prometa.git.gitlab.badges.python.black module
- prometa.git.gitlab.badges.python.hatch module
- prometa.git.gitlab.badges.python.isort module
- prometa.git.gitlab.badges.python.pylint module
- prometa.git.gitlab.badges.python.pypi module
- prometa.git.gitlab.badges.python.pypi_downloads module
- prometa.git.gitlab.badges.python.python module
- Module contents
Submodules
prometa.git.gitlab.badges.badge_manager module
Base class for each badge manager.
- class prometa.git.gitlab.badges.badge_manager.BadgeManager(gitlab_api)[source]
Bases:
Registrable
Registrable base class for each badge manager.
- create_badge(name, link_url, image_url)[source]
Create a new badge.
- Parameters:
name – The badge name.
link_url – The badge link URL.
image_url – The badge image URL.
- property enabled[source]
The badge’s name is in the
gitlab.enabled_badges
list in the configuration file.
- get_badge_by_name(name)[source]
Get a badge by name.
- Parameters:
name – The name of the badge.
- Returns:
The Badge instance, or None of not badge of the given name was found.
- property include[source]
True if the condition for including this badge is met, else False. The configuration file determines of the badge is managed whereas this property determines if the badge is added or removed when the badge is managed.
prometa.git.gitlab.badges.common module
Common functions for badge management.
- prometa.git.gitlab.badges.common.get_badge_url(label, message, color, **query_params)[source]
Get a URL to an SVG image of a custom badge generated by the img.shields.io website.
- Parameters:
label – The text on the left side of the badge.
message – The text on the right side of the badge.
color – The hexadecimal color code for the background of the message.
query_params – Additional query parameters for the img.shields.io URL.
- Returns:
The image URL as a string.
prometa.git.gitlab.badges.latest_release module
Latest release badge.
- class prometa.git.gitlab.badges.latest_release.LatestReleaseBadgeManager(gitlab_api)[source]
Bases:
BadgeManager
The latest tagged release on the project’s GitLab host. This uses the built-in GitLab release badge.
prometa.git.gitlab.badges.license module
Project license.
- class prometa.git.gitlab.badges.license.LicenseBadgeManager(gitlab_api)[source]
Bases:
BadgeManager
The project’s license name, as recognized by SPDX.
prometa.git.gitlab.badges.pipeline_status module
Pipeline status badge.
- class prometa.git.gitlab.badges.pipeline_status.PipelineStatusBadgeManager(gitlab_api)[source]
Bases:
BadgeManager
The current pipeline status on the project’s GitLab host. This uses the built-in GitLab pipeline badge.
prometa.git.gitlab.badges.test_coverage module
Test coverage badge.
- class prometa.git.gitlab.badges.test_coverage.TestCoverageBadgeManager(gitlab_api)[source]
Bases:
BadgeManager
Display the currently configured test coverage results.
Module contents
Manage project badges on GitLab.
- class prometa.git.gitlab.badges.BadgeManager(gitlab_api)[source]
Bases:
Registrable
Registrable base class for each badge manager.
- create_badge(name, link_url, image_url)[source]
Create a new badge.
- Parameters:
name – The badge name.
link_url – The badge link URL.
image_url – The badge image URL.
- property enabled[source]
The badge’s name is in the
gitlab.enabled_badges
list in the configuration file.
- get_badge_by_name(name)[source]
Get a badge by name.
- Parameters:
name – The name of the badge.
- Returns:
The Badge instance, or None of not badge of the given name was found.
- property include[source]
True if the condition for including this badge is met, else False. The configuration file determines of the badge is managed whereas this property determines if the badge is added or removed when the badge is managed.