mafw.devtools.gitlab.registry

GitLab Generic Package Registry operations.

This module centralizes the HTTP helpers for uploading, downloading, listing, and deleting files in the GitLab Generic Package Registry.

author:

Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)

mafw.devtools.gitlab.registry._infer_content_type(file_path: Path) str[source]

Infer a Content-Type from the file extension.

Parameters:

file_path (Path) – Path to the file.

Returns:

A MIME type string.

Return type:

str

mafw.devtools.gitlab.registry._CONTENT_TYPE_MAP: Final[dict[str, str]] = {'.gz': 'application/gzip', '.json': 'application/json', '.tar': 'application/x-tar', '.toml': 'application/toml', '.zip': 'application/zip'}

Mapping of file extensions to Content-Type values for registry uploads.

mafw.devtools.gitlab.registry._MAFW_VERSION_RE: Final[Pattern[str]] = re.compile('^(?:v)?(?P<version>\\d+\\.\\d+\\.\\d+)$')

Pattern for accepted MAFw version overrides.

mafw.devtools.gitlab.registry._PYLOCK_RE: Final[Pattern[str]] = re.compile('^pylock\\.py(?P<python_version>3\\.\\d+)_ref\\.toml$')

Pattern for MAFw reference dependency lock files.