Skip to content

Commit ee5b4d4

Browse files
ffvogmvfjveraericspod
authored
Excluded from MANIFEST.in and setup.py tests folder and subfolders. (#8807)
Fixes Tests are installed as a package ### Description This pull request resolves an issue introduced in commit `af9e8f96d704a1b4bbce5b5ca52e0e2b7ea076dc`, where the `tests` directory was inadvertently included as an installable package starting from MONAI 1.5.0, due to the refactor on tests that created multiple subfolders with ` __init__.py ` files on them. This caused import conflicts in downstream projects with their own local `tests` folder, as Python could mistakenly resolve imports to MONAI’s packaged `tests` module. To correct this behavior, the following adjustments are made: - `MANIFEST.in` updated to exclude the `tests` directory: ```txt exclude tests/* ``` - `setup.py` updated to prevent inclusion of `tests` and its subpackages: ```python packages = find_packages(exclude=("docs", "examples", "tests", "tests.*")) ``` These changes ensure that the MONAI test suite is not installed as part of the distributed package, restoring expected import resolution for downstream users. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Javier Vera Olmos <ffvo@gmv.com> Co-authored-by: fjvera <fjvera@gmv.com> Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent c13f520 commit ee5b4d4

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ include monai/_version.py
33

44
include README.md
55
include LICENSE
6+
7+
prune tests

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_cmds():
144144
setup(
145145
version=versioneer.get_version(),
146146
cmdclass=get_cmds(),
147-
packages=find_packages(exclude=("docs", "examples", "tests")),
147+
packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")),
148148
zip_safe=False,
149149
package_data={"monai": ["py.typed", *jit_extension_source]}, # type: ignore[arg-type]
150150
ext_modules=get_extensions(),

0 commit comments

Comments
 (0)