archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-setuptools / repos / extra-any / system-validate-pyproject.patch
blob541f990c458bc9d5fc890c1846c681e48af46da5
1 diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py
2 index d4024956..2c3bd6bf 100644
3 --- a/setuptools/config/pyprojecttoml.py
4 +++ b/setuptools/config/pyprojecttoml.py
5 @@ -27,16 +27,22 @@ def load_file(filepath: _Path) -> dict:
8 def validate(config: dict, filepath: _Path) -> bool:
9 - from . import _validate_pyproject as validator
10 + import validate_pyproject.api, validate_pyproject.errors, validate_pyproject.cli, validate_pyproject.plugins
12 - trove_classifier = validator.FORMAT_FUNCTIONS.get("trove-classifier")
13 + trove_classifier = validate_pyproject.api.FORMAT_FUNCTIONS.get("trove-classifier")
14 if hasattr(trove_classifier, "_disable_download"):
15 # Improve reproducibility by default. See issue 31 for validate-pyproject.
16 trove_classifier._disable_download() # type: ignore
18 + plugins = validate_pyproject.plugins.list_from_entry_points()
19 + validator = validate_pyproject.api.Validator(
20 + validate_pyproject.cli.select_plugins(plugins, ('setuptools', 'distutils'), ()),
21 + validate_pyproject.api.FORMAT_FUNCTIONS,
22 + )
24 try:
25 - return validator.validate(config)
26 - except validator.ValidationError as ex:
27 + return validator(config)
28 + except validate_pyproject.errors.ValidationError as ex:
29 summary = f"configuration error: {ex.summary}"
30 if ex.name.strip("`") != "project":
31 # Probably it is just a field missing/misnamed, not worthy the verbosity...