Commit 410a6e05 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #798 from timheap/faster-package-finder

Note find_packages backwards incompatible change
parents f2d480b8 992adf2f
...@@ -6,6 +6,10 @@ In development ...@@ -6,6 +6,10 @@ In development
-------------- --------------
* #733: Do not search excluded directories for packages. * #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. * #795: Bump certifi.
......
...@@ -98,6 +98,15 @@ class TestFindPackages: ...@@ -98,6 +98,15 @@ class TestFindPackages:
packages = find_packages(self.dist_dir, exclude=('pkg.*',)) packages = find_packages(self.dist_dir, exclude=('pkg.*',))
assert packages == ['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): def test_include_excludes_other(self):
""" """
If include is specified, other packages should be excluded. If include is specified, other packages should be excluded.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment