diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-09-27 13:55:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-27 13:55:58 -0500 |
commit | 410a6e053b5d31de06e88e3073f44d3e0b6b26af (patch) | |
tree | fada0c7019a2d60fb0fd6fa5a9f16404b152f768 | |
parent | f2d480b8131687eb8ff821f7d52e7cc1f13f6bc4 (diff) | |
parent | 992adf2f5684e6660335d616149e050b3eaaed17 (diff) | |
download | python-setuptools-git-410a6e053b5d31de06e88e3073f44d3e0b6b26af.tar.gz |
Merge pull request #798 from timheap/faster-package-finder
Note find_packages backwards incompatible change
-rw-r--r-- | CHANGES.rst | 4 | ||||
-rw-r--r-- | setuptools/tests/test_find_packages.py | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index cb03755a..11d9ca93 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,10 @@ In development -------------- * #733: Do not search excluded directories for packages. + This introduced a backwards incompatible change in ``find_packages()`` + so that ``find_packages(exclude=['foo']) == []``, excluding subpackages of ``foo``. + Previously, ``find_packages(exclude=['foo']) == ['foo.bar']``, + even though the parent ``foo`` package was excluded. * #795: Bump certifi. diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py index df51b04f..9d31ccd7 100644 --- a/setuptools/tests/test_find_packages.py +++ b/setuptools/tests/test_find_packages.py @@ -98,6 +98,15 @@ class TestFindPackages: packages = find_packages(self.dist_dir, exclude=('pkg.*',)) assert packages == ['pkg'] + def test_exclude_recursive(self): + """ + Excluding a parent package should exclude all child packages as well. + """ + self._touch('__init__.py', self.pkg_dir) + self._touch('__init__.py', self.sub_pkg_dir) + packages = find_packages(self.dist_dir, exclude=('pkg',)) + assert packages == [] + def test_include_excludes_other(self): """ If include is specified, other packages should be excluded. |