Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
  • Loading branch information
abravalheri and ferdnyc authored Feb 22, 2022
1 parent 6706be9 commit 1f93dd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions setuptools/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class FlatLayoutModuleFinder(ModuleFinder):
"fabfile",
# ---- Other tools ----
"[Ss][Cc]onstruct", # SCons
"conanfile", # Connan: C/C++ build tool
"conanfile", # Conan: C/C++ build tool
"manage", # Django
# ---- Hidden files/Private modules ----
"[._]*",
Expand Down Expand Up @@ -265,9 +265,9 @@ def __call__(self, force=False):
self._called = True

def _analyse_package_layout(self):
if self.dist.packages is not None or self.dist.py_modules is not None:
# For backward compatibility, just try to find modules/packages
# when nothing is given
if self.dist.packages or self.dist.py_modules:
# For backward compatibility, skip auto-discovery
# if any values have already been set by caller
return None

log.debug(
Expand Down
6 changes: 3 additions & 3 deletions setuptools/tests/test_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ def test_dist_default_py_modules(tmp_path, dist_name, py_module):
dist.set_defaults()
assert dist.py_modules == [py_module]
# When `py_modules` is given, don't do anything
dist = Distribution({**attrs, "py_modules": ["explicity_py_module"]})
dist = Distribution({**attrs, "py_modules": ["explicit_py_module"]})
dist.set_defaults()
assert dist.py_modules == ["explicity_py_module"]
assert dist.py_modules == ["explicit_py_module"]
# When `packages` is given, don't do anything
dist = Distribution({**attrs, "packages": ["explicity_package"]})
dist = Distribution({**attrs, "packages": ["explicit_package"]})
dist.set_defaults()
assert not dist.py_modules

Expand Down

0 comments on commit 1f93dd7

Please sign in to comment.