diff --git a/setup.py b/setup.py index 98461de24520..823f04ba58e8 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ import os from zipfile import ZipFile -from setuptools import setup, Extension +from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext as BuildExtCommand from setuptools.command.develop import develop as DevelopCommand from setuptools.command.install_lib import install_lib as InstallLibCommand @@ -169,12 +169,7 @@ def run(self): # however, this is needed on Windows to avoid creating infinite subprocesses # when using multiprocessing. if __name__ == '__main__': - # These are distutils.setup parameters that the various packages add - # things to. - packages = [] - namespace_packages = [] - py_modules = [] - package_data = {} + package_data = {} # Will be filled below by the various components. # If the user just queries for information, don't bother figuring out which # packages to build or install. @@ -224,9 +219,6 @@ def run(self): # Now collect all of the information we need to build all of the # packages. for package in good_packages: - packages.extend(package.get_packages()) - namespace_packages.extend(package.get_namespace_packages()) - py_modules.extend(package.get_py_modules()) # Extension modules only get added in build_ext, as numpy will have # been installed (as setup_requires) at that point. data = package.get_package_data() @@ -267,14 +259,14 @@ def run(self): interfaces and hardcopy output formats. """, license="PSF", - packages=packages, - namespace_packages=namespace_packages, - platforms='any', - py_modules=py_modules, + platforms="any", + package_dir={"": "lib"}, + packages=find_packages("lib"), + namespace_packages=["mpl_toolkits"], + py_modules=["pylab"], # Dummy extension to trigger build_ext, which will swap it out with # real extensions that can depend on numpy for the build. ext_modules=[Extension("", [])], - package_dir={"": "lib"}, package_data=package_data, classifiers=classifiers, diff --git a/setupext.py b/setupext.py index e0a805bdd4f7..fc22b404f777 100644 --- a/setupext.py +++ b/setupext.py @@ -8,7 +8,6 @@ import os import pathlib import platform -import setuptools import shlex import shutil import subprocess @@ -310,30 +309,6 @@ def check(self): """ pass - def get_packages(self): - """ - Get a list of package names to add to the configuration. - These are added to the `packages` list passed to - `distutils.setup`. - """ - return [] - - def get_namespace_packages(self): - """ - Get a list of namespace package names to add to the configuration. - These are added to the `namespace_packages` list passed to - `distutils.setup`. - """ - return [] - - def get_py_modules(self): - """ - Get a list of top-level modules to add to the configuration. - These are added to the `py_modules` list passed to - `distutils.setup`. - """ - return [] - def get_package_data(self): """ Get a package data dictionary to add to the configuration. @@ -485,15 +460,6 @@ class Matplotlib(SetupPackage): def check(self): return versioneer.get_version() - def get_packages(self): - return setuptools.find_packages("lib", exclude=["*.tests"]) - - def get_namespace_packages(self): - return ['mpl_toolkits'] - - def get_py_modules(self): - return ['pylab'] - def get_package_data(self): return { 'matplotlib': [ @@ -525,9 +491,6 @@ class Tests(OptionalPackage): name = "tests" default_config = False - def get_packages(self): - return setuptools.find_packages("lib", include=["*.tests"]) - def get_package_data(self): return { 'matplotlib': [