Skip to content
Back to top
View this page

# twine.commands.check module

Module containing the logic for `twine check`.

class twine.commands.check._WarningStream
  write(text: str) → int

    Write string to file.

    Returns the number of characters written, which is always equal to the length of the string.

twine.commands.check._parse_content_type(value: str) → Tuple[str, Dict[str, str]]

  Implement logic of deprecated cgi.parse_header().

  From https://docs.python.org/3.11/library/cgi.html#cgi.parse_header.

twine.commands.check._check_file(filename: str, render_warning_stream: _WarningStream) → Tuple[List[str], bool]

  Check given distribution.

twine.commands.check.check(dists: List[str], strict: bool = False) → bool

  Check that a distribution will render correctly on PyPI and display the results.

  This is currently only validates `long_description`, but more checks could be added.

  Parameters:

    - dists – The distribution files to check.

    - output_stream – The destination of the resulting output.

    - strict – If `True`, treat warnings as errors.

  Returns:

    `True` if there are rendering errors, otherwise `False`.

twine.commands.check.main(args: List[str]) → bool

  Execute the `check` command.

  Parameters:

    args – The command-line arguments.

  Returns:

    The exit status of the `check` command.