diff options
author | Carsten Klein <trancesilken@gmail.com> | 2018-08-17 14:58:35 +0200 |
---|---|---|
committer | Paul Ganssle <pganssle@users.noreply.github.com> | 2018-08-17 08:58:35 -0400 |
commit | 0254a2fda8e8bd4f289d01e2179191e936517f04 (patch) | |
tree | 6007c5bc0b659c4d69ffbcc8df917f7a0c747cdf /setuptools/config.py | |
parent | bbf99b7e599766e15dc56f58f68fe6c32c972faf (diff) | |
download | external_python_setuptools-0254a2fda8e8bd4f289d01e2179191e936517f04.tar.gz external_python_setuptools-0254a2fda8e8bd4f289d01e2179191e936517f04.tar.bz2 external_python_setuptools-0254a2fda8e8bd4f289d01e2179191e936517f04.zip |
Rename find_namepaces_ns to find_namespace_packages (#1423)
* fix #1419 PEP420: add find_namespace: directive
* fix #1419 PEP420: add find_namespace: directive to documentation
* fix #1419 PEP420: add tests
* fix #1419 PEP420: clean up code
* fix #1419 PEP420: fix typo in documentation
* fix #1419 PEP420: fix typo in documentation
* fix #1419 PEP420: clean up code
* fix #1419 PEP420: add changelog entry
* fixup! fix #1419 PEP420: add tests
* fix #1419 PEP420: cleanup code refactor markers
* #1420: Rename find_namespace_ns to find_namespace_packages
* #1420: update changelog entry
Diffstat (limited to 'setuptools/config.py')
-rw-r--r-- | setuptools/config.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/setuptools/config.py b/setuptools/config.py index 5f908cf1..0da3dbc9 100644 --- a/setuptools/config.py +++ b/setuptools/config.py @@ -8,7 +8,7 @@ from importlib import import_module from distutils.errors import DistutilsOptionError, DistutilsFileError from setuptools.extern.packaging.version import LegacyVersion, parse -from setuptools.extern.six import string_types +from setuptools.extern.six import string_types, PY3 __metaclass__ = type @@ -515,16 +515,24 @@ class ConfigOptionsHandler(ConfigHandler): :param value: :rtype: list """ - find_directive = 'find:' + find_directives = ['find:', 'find_namespace:'] + trimmed_value = value.strip() - if not value.startswith(find_directive): + if not trimmed_value in find_directives: return self._parse_list(value) + findns = trimmed_value == find_directives[1] + if findns and not PY3: + raise DistutilsOptionError('find_namespace: directive is unsupported on Python < 3.3') + # Read function arguments from a dedicated section. find_kwargs = self.parse_section_packages__find( self.sections.get('packages.find', {})) - from setuptools import find_packages + if findns: + from setuptools import find_namespace_packages as find_packages + else: + from setuptools import find_packages return find_packages(**find_kwargs) |