|
23 | 23 | import os |
24 | 24 | from zipfile import ZipFile |
25 | 25 |
|
26 | | -from setuptools import setup, Extension |
| 26 | +from setuptools import setup, find_packages, Extension |
27 | 27 | from setuptools.command.build_ext import build_ext as BuildExtCommand |
28 | 28 | from setuptools.command.develop import develop as DevelopCommand |
29 | 29 | from setuptools.command.install_lib import install_lib as InstallLibCommand |
@@ -169,12 +169,7 @@ def run(self): |
169 | 169 | # however, this is needed on Windows to avoid creating infinite subprocesses |
170 | 170 | # when using multiprocessing. |
171 | 171 | if __name__ == '__main__': |
172 | | - # These are distutils.setup parameters that the various packages add |
173 | | - # things to. |
174 | | - packages = [] |
175 | | - namespace_packages = [] |
176 | | - py_modules = [] |
177 | | - package_data = {} |
| 172 | + package_data = {} # Will be filled below by the various components. |
178 | 173 |
|
179 | 174 | # If the user just queries for information, don't bother figuring out which |
180 | 175 | # packages to build or install. |
@@ -224,9 +219,6 @@ def run(self): |
224 | 219 | # Now collect all of the information we need to build all of the |
225 | 220 | # packages. |
226 | 221 | for package in good_packages: |
227 | | - packages.extend(package.get_packages()) |
228 | | - namespace_packages.extend(package.get_namespace_packages()) |
229 | | - py_modules.extend(package.get_py_modules()) |
230 | 222 | # Extension modules only get added in build_ext, as numpy will have |
231 | 223 | # been installed (as setup_requires) at that point. |
232 | 224 | data = package.get_package_data() |
@@ -267,14 +259,14 @@ def run(self): |
267 | 259 | interfaces and hardcopy output formats. |
268 | 260 | """, |
269 | 261 | license="PSF", |
270 | | - packages=packages, |
271 | | - namespace_packages=namespace_packages, |
272 | | - platforms='any', |
273 | | - py_modules=py_modules, |
| 262 | + platforms="any", |
| 263 | + package_dir={"": "lib"}, |
| 264 | + packages=find_packages("lib"), |
| 265 | + namespace_packages=["mpl_toolkits"], |
| 266 | + py_modules=["pylab"], |
274 | 267 | # Dummy extension to trigger build_ext, which will swap it out with |
275 | 268 | # real extensions that can depend on numpy for the build. |
276 | 269 | ext_modules=[Extension("", [])], |
277 | | - package_dir={"": "lib"}, |
278 | 270 | package_data=package_data, |
279 | 271 | classifiers=classifiers, |
280 | 272 |
|
|
0 commit comments