Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix add htmlcov to flat layout package finder.default exclude #3836

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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