diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-19 03:53:09 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-19 03:53:09 +0000 |
| commit | 1cdda8476f1f0ac99932494c1a129c021c5a9ccd (patch) | |
| tree | 4352fc908cf684e2856b51f17169d0d26b049caa /setuptools/discovery.py | |
| parent | 20a95398a3ba68bb8829539d0dda31ee79056a8b (diff) | |
| download | python-setuptools-git-1cdda8476f1f0ac99932494c1a129c021c5a9ccd.tar.gz | |
Prevent setup_requires patches from activating auto-discovery
Diffstat (limited to 'setuptools/discovery.py')
| -rw-r--r-- | setuptools/discovery.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/setuptools/discovery.py b/setuptools/discovery.py index 5c21199e..5ec5d584 100644 --- a/setuptools/discovery.py +++ b/setuptools/discovery.py @@ -273,8 +273,13 @@ class ConfigDiscovery: def __init__(self, distribution: "Distribution"): self.dist = distribution self._called = False + self._disabled = False self._root_dir: _Path # delay so `src_root` can be set in dist + def _disable(self): + """Internal API to disable automatic discovery""" + self._disabled = True + def __call__(self, force=False, name=True): """Automatically discover missing configuration fields and modifies the given ``distribution`` object in-place. @@ -286,7 +291,7 @@ class ConfigDiscovery: directory changes), please use ``force=True`` (or create a new ``ConfigDiscovery`` instance). """ - if force is False and self._called: + if force is False and (self._called or self._disabled): # Avoid overhead of multiple calls return |
