summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setuptools/config/_validate_pyproject/NOTICE (renamed from setuptools/_vendor/_validate_pyproject/NOTICE)4
-rw-r--r--setuptools/config/_validate_pyproject/__init__.py (renamed from setuptools/_vendor/_validate_pyproject/__init__.py)0
-rw-r--r--setuptools/config/_validate_pyproject/error_reporting.py (renamed from setuptools/_vendor/_validate_pyproject/error_reporting.py)0
-rw-r--r--setuptools/config/_validate_pyproject/extra_validations.py (renamed from setuptools/_vendor/_validate_pyproject/extra_validations.py)0
-rw-r--r--setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py (renamed from setuptools/_vendor/_validate_pyproject/fastjsonschema_exceptions.py)0
-rw-r--r--setuptools/config/_validate_pyproject/fastjsonschema_validations.py (renamed from setuptools/_vendor/_validate_pyproject/fastjsonschema_validations.py)0
-rw-r--r--setuptools/config/_validate_pyproject/formats.py (renamed from setuptools/_vendor/_validate_pyproject/formats.py)0
-rw-r--r--setuptools/config/pyprojecttoml.py14
-rw-r--r--setuptools/extern/__init__.py3
9 files changed, 7 insertions, 14 deletions
diff --git a/setuptools/_vendor/_validate_pyproject/NOTICE b/setuptools/config/_validate_pyproject/NOTICE
index 8ed8325e..b426f7fd 100644
--- a/setuptools/_vendor/_validate_pyproject/NOTICE
+++ b/setuptools/config/_validate_pyproject/NOTICE
@@ -1,7 +1,7 @@
The code contained in this directory was automatically generated using the
following command:
- python -m validate_pyproject.vendoring --output-dir=setuptools/_vendor/_validate_pyproject --enable-plugins setuptools distutils --very-verbose
+ python -m validate_pyproject.vendoring --output-dir=setuptools/config/_validate_pyproject --enable-plugins setuptools distutils --very-verbose
Please avoid changing it manually.
@@ -31,7 +31,7 @@ by the same projects:
- `__init__.py`
- `fastjsonschema_validations.py`
-The relevant copyright notes and licenses are included below.
+The relevant copyright notes and licenses are included bellow.
***
diff --git a/setuptools/_vendor/_validate_pyproject/__init__.py b/setuptools/config/_validate_pyproject/__init__.py
index dbe6cb4c..dbe6cb4c 100644
--- a/setuptools/_vendor/_validate_pyproject/__init__.py
+++ b/setuptools/config/_validate_pyproject/__init__.py
diff --git a/setuptools/_vendor/_validate_pyproject/error_reporting.py b/setuptools/config/_validate_pyproject/error_reporting.py
index 3a4d4e9e..3a4d4e9e 100644
--- a/setuptools/_vendor/_validate_pyproject/error_reporting.py
+++ b/setuptools/config/_validate_pyproject/error_reporting.py
diff --git a/setuptools/_vendor/_validate_pyproject/extra_validations.py b/setuptools/config/_validate_pyproject/extra_validations.py
index 48c4e257..48c4e257 100644
--- a/setuptools/_vendor/_validate_pyproject/extra_validations.py
+++ b/setuptools/config/_validate_pyproject/extra_validations.py
diff --git a/setuptools/_vendor/_validate_pyproject/fastjsonschema_exceptions.py b/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
index d2dddd6a..d2dddd6a 100644
--- a/setuptools/_vendor/_validate_pyproject/fastjsonschema_exceptions.py
+++ b/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
diff --git a/setuptools/_vendor/_validate_pyproject/fastjsonschema_validations.py b/setuptools/config/_validate_pyproject/fastjsonschema_validations.py
index 3ad1edd0..3ad1edd0 100644
--- a/setuptools/_vendor/_validate_pyproject/fastjsonschema_validations.py
+++ b/setuptools/config/_validate_pyproject/fastjsonschema_validations.py
diff --git a/setuptools/_vendor/_validate_pyproject/formats.py b/setuptools/config/_validate_pyproject/formats.py
index a288eb5f..a288eb5f 100644
--- a/setuptools/_vendor/_validate_pyproject/formats.py
+++ b/setuptools/config/_validate_pyproject/formats.py
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py
index e20d71d2..9666ca18 100644
--- a/setuptools/config/pyprojecttoml.py
+++ b/setuptools/config/pyprojecttoml.py
@@ -26,18 +26,12 @@ def load_file(filepath: _Path) -> dict:
return tomli.load(file)
-def validate(config: dict, filepath: _Path):
- from setuptools.extern._validate_pyproject import validate as _validate
+def validate(config: dict, filepath: _Path) -> bool:
+ from . import _validate_pyproject as validator
try:
- return _validate(config)
- except Exception as ex:
- if ex.__class__.__name__ != "ValidationError":
- # Workaround for the fact that `extern` can duplicate imports
- ex_cls = ex.__class__.__name__
- error = ValueError(f"invalid pyproject.toml config: {ex_cls} - {ex}")
- raise error from None
-
+ return validator._validate(config)
+ except validator.ValidationError as ex:
_logger.error(f"configuration error: {ex.summary}") # type: ignore
_logger.debug(ex.details) # type: ignore
error = ValueError(f"invalid pyproject.toml config: {ex.name}") # type: ignore
diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py
index f09b7faa..192e55f6 100644
--- a/setuptools/extern/__init__.py
+++ b/setuptools/extern/__init__.py
@@ -71,7 +71,6 @@ class VendorImporter:
names = (
'packaging', 'pyparsing', 'ordered_set', 'more_itertools', 'importlib_metadata',
- 'zipp', 'importlib_resources', 'jaraco', 'typing_extensions', 'nspektr',
- 'tomli', '_validate_pyproject',
+ 'zipp', 'importlib_resources', 'jaraco', 'typing_extensions', 'nspektr', 'tomli',
)
VendorImporter(__name__, names, 'setuptools._vendor').install()