idiap_devtools.gitlab.release#
Utilities to needed to release packages.
Functions
|
Find the name of the latest tag for a given package in the format '#.#.#'. |
|
Returns the next version of this package to be tagged. |
|
Releases a package. |
|
Update (via a commit) files of a given gitlab package, directly on the default project branch. |
|
Using sleep function, wait for the latest pipeline to finish building. |
- idiap_devtools.gitlab.release.get_latest_tag_name(gitpkg)[source]#
Find the name of the latest tag for a given package in the format ‘#.#.#’.
- idiap_devtools.gitlab.release.get_next_version(gitpkg, bump)[source]#
Returns the next version of this package to be tagged.
- Parameters:
- Return type:
- Returns:
The new version of the package (to be tagged)
- Raises:
ValueError – if the latest tag retrieve from the package does not conform with the subset of PEP440 we use (e.g. “v1.2.3b1”).
- idiap_devtools.gitlab.release.update_files_at_default_branch(gitpkg, files_dict, message, dry_run)[source]#
Update (via a commit) files of a given gitlab package, directly on the default project branch.
- idiap_devtools.gitlab.release.wait_for_pipeline_to_finish(gitpkg, pipeline_id)[source]#
Using sleep function, wait for the latest pipeline to finish building.
This function pauses the script until pipeline completes either successfully or with error.
- idiap_devtools.gitlab.release.release_package(gitpkg, tag_name, tag_comments, dry_run=False, profile=None)[source]#
Releases a package.
The provided tag will be annotated with a given list of comments. Files such as
README.md
andpyproject.toml
will be updated according to the release procedures.- Parameters:
gitpkg (
Project
) – gitlab package objecttag_name (
str
) – The name of the release tagtag_comments_list – New annotations for this tag in a form of list
dry_run (
bool
) – IfTrue
, nothing will be committed or pushed to GitLabprofile (
Optional
[Profile
]) – An instance ofidiap_devtools.profile.Profile
used to retrieve the specifiers to pin the package’s dependencies inpyproject.toml
.
- Return type:
- Returns:
The (integer) pipeline identifier, or None, if a pipeline was not actually started (e.g.
dry_run
is set toTrue
)