Skip to content

Commit

Permalink
Fixed interaction between discovery and htmlcov (#3836)
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Mar 6, 2023
2 parents 83c399a + 46db21a commit 865d790
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions changelog.d/3836.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Fixed interaction between ``setuptools``' package auto-discovery and
auto-generated ``htmlcov`` files.

Previously, the ``htmlcov`` name was ignored when searching for single-file
modules, however the correct behaviour is to ignore it when searching for
packages (since it is supposed to be a directory, see `coverage config`_)
-- by :user:`yukihiko-shinoda`.

.. _coverage config: https://coverage.readthedocs.io/en/stable/config.html#html-directory
2 changes: 1 addition & 1 deletion setuptools/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class FlatLayoutPackageFinder(PEP420PackageFinder):
"benchmarks",
"exercise",
"exercises",
"htmlcov", # Coverage.py
# ---- Hidden directories/Private packages ----
"[._]*",
)
Expand Down Expand Up @@ -273,7 +274,6 @@ class FlatLayoutModuleFinder(ModuleFinder):
"benchmarks",
"exercise",
"exercises",
"htmlcov",
# ---- Hidden files/Private modules ----
"[._]*",
)
Expand Down
1 change: 1 addition & 0 deletions setuptools/tests/test_find_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class TestFlatLayoutPackageFinder:
),
"tool-specific": (
[
"htmlcov/index.html",
"pkg/__init__.py",
"tasks/__init__.py",
"tasks/subpackage/__init__.py",
Expand Down

0 comments on commit 865d790

Please sign in to comment.