jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/583564 )
Change subject: [IMPR] Use find_namespace_packages with Python 3 ......................................................................
[IMPR] Use find_namespace_packages with Python 3
Use find_namespace_packages in favour of find_packages with Python 3
Change-Id: I5897ccfd17d461c1fd334b722278d6dc51a2b619 --- M setup.py 1 file changed, 14 insertions(+), 4 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/setup.py b/setup.py index af8b022..049c2a8 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ import os import sys
-from setuptools import find_packages, setup +from setuptools import setup
PYTHON_VERSION = sys.version_info[:3] PY2 = (PYTHON_VERSION[0] == 2) @@ -210,6 +210,18 @@ return ''.join(desc)
+def get_packages(name): + """Find framework packages.""" + if PY2: + from setuptools import find_packages + packages = [package for package in find_packages() + if package.startswith(name + '.')] + else: + from setuptools import find_namespace_packages + packages = find_namespace_packages(include=[name + '.*']) + return [str(name)] + packages + + def main(): """Setup entry point.""" name = 'pywikibot' @@ -224,9 +236,7 @@ maintainer='The Pywikibot team', maintainer_email='pywikibot@lists.wikimedia.org', license='MIT License', - packages=[str(name)] + [package - for package in find_packages() - if package.startswith('pywikibot.')], + packages=get_packages(name), python_requires='>=2.7.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', install_requires=dependencies, extras_require=extra_deps,
pywikibot-commits@lists.wikimedia.org