From 7a66ab24766002c8dff8bb0d8a315c23a3fbc9fd Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Wed, 30 Mar 2022 21:17:46 +0100 Subject: Update validate-pyproject to v0.7.1 --- setuptools/config/_validate_pyproject/error_reporting.py | 2 +- setuptools/config/_validate_pyproject/formats.py | 7 ++++++- tox.ini | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/setuptools/config/_validate_pyproject/error_reporting.py b/setuptools/config/_validate_pyproject/error_reporting.py index 3a4d4e9e..f78e4838 100644 --- a/setuptools/config/_validate_pyproject/error_reporting.py +++ b/setuptools/config/_validate_pyproject/error_reporting.py @@ -313,6 +313,6 @@ class _SummaryWriter: def _separate_terms(word: str) -> List[str]: """ >>> _separate_terms("FooBar-foo") - "foo bar foo" + ['foo', 'bar', 'foo'] """ return [w.lower() for w in _CAMEL_CASE_SPLITTER.split(word) if w] diff --git a/setuptools/config/_validate_pyproject/formats.py b/setuptools/config/_validate_pyproject/formats.py index 4f23d98a..f41fce38 100644 --- a/setuptools/config/_validate_pyproject/formats.py +++ b/setuptools/config/_validate_pyproject/formats.py @@ -131,12 +131,17 @@ class _TroveClassifier: def __init__(self): self.downloaded: typing.Union[None, False, typing.Set[str]] = None + self._skip_download = False # None => not cached yet # False => cache not available self.__name__ = "trove_classifier" # Emulate a public function + def _disable_download(self): + # This is a private API. Only setuptools has the consent of using it. + self._skip_download = True + def __call__(self, value: str) -> bool: - if self.downloaded is False: + if self.downloaded is False or self._skip_download is True: return True if os.getenv("NO_NETWORK") or os.getenv("VALIDATE_PYPROJECT_NO_NETWORK"): diff --git a/tox.ini b/tox.ini index e3dd03fb..973f3763 100644 --- a/tox.ini +++ b/tox.ini @@ -68,7 +68,7 @@ commands = [testenv:generate-validation-code] skip_install = True deps = - validate-pyproject[all]==0.7 + validate-pyproject[all]==0.7.1 commands = python -m tools.generate_validation_code -- cgit v1.2.1