Utils package names
| FUNCTION | DESCRIPTION |
|---|---|
compare_package_names |
Compare the package names from |
normalize_package_name |
Implement PyPa specifications for package-name normalization |
Functions:¶
_parse_wheel_filename(wheel_filename)
¶
Extract distribution and version from a wheel filename.
The structure of a wheel filename is fixed, and it must start with
{distribution}-{version} (see
https://packaging.python.org/en/latest/specifications/binary-distribution-format
).
Note that we transform exceptions in ValueErrors, since this function is
also used within Pydantic validators.
Source code in fractal_server/tasks/v2/utils_package_names.py
compare_package_names(*, pkg_name_pip_show, pkg_name_task_group, logger_name)
¶
Compare the package names from pip show and from the db.
Source code in fractal_server/tasks/v2/utils_package_names.py
normalize_package_name(name)
¶
Implement PyPa specifications for package-name normalization
The name should be lowercased with all runs of the characters ., -,
or _ replaced with a single - character. This can be implemented in
Python with the re module.
(https://packaging.python.org/en/latest/specifications/name-normalization)
| PARAMETER | DESCRIPTION |
|---|---|
|
The non-normalized package name.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The normalized package name. |