summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/3836.misc.rst9
-rw-r--r--setuptools/discovery.py2
-rw-r--r--setuptools/tests/test_find_packages.py1
3 files changed, 11 insertions, 1 deletions
diff --git a/changelog.d/3836.misc.rst b/changelog.d/3836.misc.rst
new file mode 100644
index 00000000..95232cca
--- /dev/null
+++ b/changelog.d/3836.misc.rst
@@ -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
diff --git a/setuptools/discovery.py b/setuptools/discovery.py
index 6244a185..f053dba8 100644
--- a/setuptools/discovery.py
+++ b/setuptools/discovery.py
@@ -234,6 +234,7 @@ class FlatLayoutPackageFinder(PEP420PackageFinder):
"benchmarks",
"exercise",
"exercises",
+ "htmlcov", # Coverage.py
# ---- Hidden directories/Private packages ----
"[._]*",
)
@@ -273,7 +274,6 @@ class FlatLayoutModuleFinder(ModuleFinder):
"benchmarks",
"exercise",
"exercises",
- "htmlcov",
# ---- Hidden files/Private modules ----
"[._]*",
)
diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py
index efcce924..6c605e02 100644
--- a/setuptools/tests/test_find_packages.py
+++ b/setuptools/tests/test_find_packages.py
@@ -217,6 +217,7 @@ class TestFlatLayoutPackageFinder:
),
"tool-specific": (
[
+ "htmlcov/index.html",
"pkg/__init__.py",
"tasks/__init__.py",
"tasks/subpackage/__init__.py",