pyproject_parser.cli

Command line interface.

New in version 0.2.0.

Attention

This module has the following additional requirements:

click>=7.1.2
consolekit>=1.4.1
sdjson>=0.3.1

These can be installed as follows:

python -m pip install pyproject-parser[cli]

Classes:

Functions:

prettify_deprecation_warning()

Catch PyProjectDeprecationWarnings and format them prettily for the command line.

resolve_class(raw_class_string, name)

Resolve the class name for the -P / --parser-class and -E / --encoder-class options.

class ConfigTracebackHandler[source]

Bases: TracebackHandler

consolekit.tracebacks.TracebackHandler which handles dom_toml.parser.BadConfigError.

has_traceback_option = True

Type:    bool

Whether to show the message Use '--traceback' to view the full traceback. on error. Enabled by default.

New in version 0.5.0: In previous versions this was effectively False.

Changed in version 0.6.0: The message is now indented with four spaces.

resolve_class(raw_class_string, name)[source]

Resolve the class name for the -P / --parser-class and -E / --encoder-class options.

Parameters
  • raw_class_string (str)

  • name (str) – The name of the option, e.g. encoder-class. Used for error messages.

Return type

Type

prettify_deprecation_warning()[source]

Catch PyProjectDeprecationWarnings and format them prettily for the command line.

New in version 0.5.0.