diff --git a/changelog.d/3836.misc.rst b/changelog.d/3836.misc.rst new file mode 100644 index 0000000000..95232cca4e --- /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 6244a18558..f053dba837 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 efcce924e5..6c605e02b4 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",