From 80fc5b6d418b2df0243989b1b8c999f795f3f55e Mon Sep 17 00:00:00 2001 From: Wyatt Lee Baldwin Date: Wed, 12 Feb 2014 00:52:26 -0800 Subject: Add support for PEP 420 namespace packages to find_packages() On Python 3.3+, `find_packages()` now considers any subdirectory of the start directory that's not a regular package (i.e., that doesn't have an `__init__.py`) to be a namespace package. The other way this supports PEP 420 is by making sure `__pycache__` directories are never added to the list of packages. Fixes issue #97 --- setuptools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'setuptools/__init__.py') diff --git a/setuptools/__init__.py b/setuptools/__init__.py index a96e4c9d..86afab63 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -56,7 +56,10 @@ def find_packages(where='.', exclude=(), include=()): looks_like_package = ( '.' not in name and os.path.isdir(fn) - and os.path.isfile(os.path.join(fn, '__init__.py')) + and ( + os.path.isfile(os.path.join(fn, '__init__.py')) + or sys.version_info[:2] >= (3, 3) # PEP 420 + ) ) if looks_like_package: pkg_name = prefix + name -- cgit v1.2.1