validate_pyproject.api

Retrieve JSON schemas for validating dicts representing a pyproject.toml file.

class validate_pyproject.api.Validator(plugins: ~typing.Sequence[PluginProtocol] | ~validate_pyproject.api.AllPlugins = AllPlugins.ALL_PLUGINS, format_validators: ~typing.Mapping[str, ~typing.Callable[[str], bool]] = mappingproxy({'chain': <class 'itertools.chain'>, 'pep440': <function pep440>, 'pep508-identifier': <function pep508_identifier>, 'pep508': <function pep508>, 'pep508-versionspec': <function pep508_versionspec>, 'pep517-backend-reference': <function pep517_backend_reference>, 'trove-classifier': <function trove_classifier>, 'pep561-stub-name': <function pep561_stub_name>, 'url': <function url>, 'python-identifier': <function python_identifier>, 'python-qualified-identifier': <function python_qualified_identifier>, 'python-module-name': <function python_module_name>, 'python-entrypoint-group': <function python_entrypoint_group>, 'python-entrypoint-name': <function python_entrypoint_name>, 'python-entrypoint-reference': <function python_entrypoint_reference>, 'uint8': <function uint8>, 'uint16': <function uint16>, 'uint': <function uint>, 'int': <function int>}), extra_validations: ~typing.Sequence[~typing.Callable[[~validate_pyproject.types.T], ~validate_pyproject.types.T]] = (<function validate_project_dynamic>,), *, extra_plugins: ~typing.Sequence[PluginProtocol] = ())[source]

Bases: object

__call__(pyproject: T) T[source]

Checks a parsed pyproject.toml file (given as typing.Mapping) and raises an exception when it is not a valid.

property extra_validations: Sequence[Callable[[T], T]]

List of extra validation functions that run after the JSON Schema check

property formats: Mapping[str, Callable[[str], bool]]

Mapping between JSON Schema formats and functions that validates them

property generated_code: str
property registry: SchemaRegistry
property schema: Schema

Top level pyproject.toml JSON Schema