Skip to content
Open
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
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include versioneer.py
include monai/_version.py

exclude tests/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In setuptools MANIFEST.in, does exclude tests/*match files in nested subdirectories, and isprune tests the correct way to exclude the full tests tree from sdist?

💡 Result:

  • exclude tests/* will not match files in nested subdirectories like tests/unit/test_x.py; in MANIFEST.in glob patterns, * does not match path separators (so it only matches the immediate children of tests/). [1]
  • To exclude the entire top-level tests/ tree from the sdist, prune tests is the appropriate directive (it removes all files under directories matching tests, relative to the project root). [1]
  • Alternative equivalent: recursive-exclude tests * (remove everything under tests/). [1]

Source: Setuptools MANIFEST.in command and glob semantics documentation. [1]


Use prune tests instead of exclude tests/* to exclude the entire tests directory from sdist.

The * pattern in MANIFEST.in does not match path separators, so exclude tests/* only excludes immediate children and will miss nested files like tests/unit/test_x.py.

Proposed fix
-exclude tests/*
+prune tests
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@MANIFEST.in` at line 3, Replace the problematic MANIFEST.in pattern "exclude
tests/*" with the correct directive "prune tests" so the entire tests directory
(including nested files and subdirectories) is excluded from source
distributions; update the MANIFEST.in entry that currently contains exclude
tests/* to use prune tests instead.

include README.md
include LICENSE
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def get_cmds():
setup(
version=versioneer.get_version(),
cmdclass=get_cmds(),
packages=find_packages(exclude=("docs", "examples", "tests")),
packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")),
zip_safe=False,
package_data={"monai": ["py.typed", *jit_extension_source]}, # type: ignore[arg-type]
ext_modules=get_extensions(),
Expand Down
Loading