Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc for canonicalize_version and a typo in a docstring #801

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ Reference
>>> is_normalized_name("Django")
False

.. function:: canonicalize_version(version)
.. function:: canonicalize_version(version, strip_trailing_zero=True)

This function takes a string representing a package version (or a
:class:`~packaging.version.Version` instance), and returns the
normalized form of it.
normalized form of it. By default, it strips trailing zeros from
the release segment.

:param str version: The version to normalize.

Expand Down
2 changes: 1 addition & 1 deletion src/packaging/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class RawMetadata(TypedDict, total=False):


def _parse_keywords(data: str) -> list[str]:
"""Split a string of comma-separate keyboards into a list of keywords."""
"""Split a string of comma-separated keywords into a list of keywords."""
return [k.strip() for k in data.split(",")]


Expand Down
Loading