Skip to content

Commit 865d790

Browse files
committed
Fixed interaction between discovery and htmlcov (#3836)
2 parents 83c399a + 46db21a commit 865d790

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

changelog.d/3836.misc.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Fixed interaction between ``setuptools``' package auto-discovery and
2+
auto-generated ``htmlcov`` files.
3+
4+
Previously, the ``htmlcov`` name was ignored when searching for single-file
5+
modules, however the correct behaviour is to ignore it when searching for
6+
packages (since it is supposed to be a directory, see `coverage config`_)
7+
-- by :user:`yukihiko-shinoda`.
8+
9+
.. _coverage config: https://coverage.readthedocs.io/en/stable/config.html#html-directory

setuptools/discovery.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ class FlatLayoutPackageFinder(PEP420PackageFinder):
234234
"benchmarks",
235235
"exercise",
236236
"exercises",
237+
"htmlcov", # Coverage.py
237238
# ---- Hidden directories/Private packages ----
238239
"[._]*",
239240
)
@@ -273,7 +274,6 @@ class FlatLayoutModuleFinder(ModuleFinder):
273274
"benchmarks",
274275
"exercise",
275276
"exercises",
276-
"htmlcov",
277277
# ---- Hidden files/Private modules ----
278278
"[._]*",
279279
)

setuptools/tests/test_find_packages.py

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class TestFlatLayoutPackageFinder:
217217
),
218218
"tool-specific": (
219219
[
220+
"htmlcov/index.html",
220221
"pkg/__init__.py",
221222
"tasks/__init__.py",
222223
"tasks/subpackage/__init__.py",

0 commit comments

Comments
 (0)