diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-05 16:48:11 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-09 15:07:57 +0000 |
| commit | 12832c1cd421f614eeab6f46ae198610a2684bca (patch) | |
| tree | 20bb3ab58f9e179285e73432998bc247cc6097b9 /setuptools/discovery.py | |
| parent | fccbdde4179247dd0070386a6651228149d5b294 (diff) | |
| download | python-setuptools-git-12832c1cd421f614eeab6f46ae198610a2684bca.tar.gz | |
Allow package_dir autodiscovery for setup.cfg
Diffstat (limited to 'setuptools/discovery.py')
| -rw-r--r-- | setuptools/discovery.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/discovery.py b/setuptools/discovery.py index 2eb1f5ea..ca61afe8 100644 --- a/setuptools/discovery.py +++ b/setuptools/discovery.py @@ -243,7 +243,7 @@ class ConfigDiscovery: self._called = False self._root_dir = None # delay so `src_root` can be set in dist - def __call__(self, force=False): + def __call__(self, force=False, name=True): """Automatically discover missing configuration fields and modifies the given ``distribution`` object in-place. @@ -261,7 +261,8 @@ class ConfigDiscovery: self._root_dir = self.dist.src_root or os.curdir self._analyse_package_layout() - self._analyse_name() # depends on ``packages`` and ``py_modules`` + if name: + self.analyse_name() # depends on ``packages`` and ``py_modules`` self._called = True @@ -329,7 +330,7 @@ class ConfigDiscovery: log.debug(f"`flat-layout` detected -- analysing {self._root_dir}") return True - def _analyse_name(self): + def analyse_name(self): """The packages/modules are the essential contribution of the author. Therefore the name of the distribution can be derived from them. """ |
