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

Document exceptions raised by functions in utils #544

Merged
merged 3 commits into from
Aug 19, 2022
Merged
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
15 changes: 15 additions & 0 deletions docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Reference
instance of :class:`~packaging.tags.Tag`.

:param str filename: The name of the wheel file.
:raises InvalidWheelFilename: If the filename in question
does not follow conventions outlined in `PEP 427`_.

.. doctest::

Expand All @@ -87,6 +89,9 @@ Reference
represented by an instance of :class:`~packaging.version.Version`.

:param str filename: The name of the sdist file.
:raises InvalidSdistFilename: If the filename does not end
with an sdist extension (``.zip`` or ``.tar.gz``), or if it does not
contain a dash separating the name and the version of the distribution.

.. doctest::

Expand All @@ -98,4 +103,14 @@ Reference
>>> ver == Version('1.0')
True


.. exception:: InvalidWheelFilename

Raised when a file name for a wheel is invalid.

.. exception:: InvalidSdistFilename

Raised when a source distribution file name is considered invalid.

.. _Source distribution format: https://packaging.python.org/specifications/source-distribution-format/#source-distribution-file-name
.. _`PEP 427`: https://peps.python.org/pep-0427/#file-name-convention