summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-06 09:45:02 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-06 09:45:02 +0000
commit865d7902d73b49d203511238f95a5f0f770e78bf (patch)
tree6e39a1f27f01fd1fc3e4ae29ef46718b32b1b3ae
parent83c399a3498b7855746ec640710fa2002afb31bd (diff)
parent46db21ae30d2d0d3c216434cfa603aef24f3a97c (diff)
downloadpython-setuptools-git-865d7902d73b49d203511238f95a5f0f770e78bf.tar.gz
Fixed interaction between discovery and htmlcov (#3836)
-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",