Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc60df5e

Browse files
committed
In setup.py, inline the packages that need to be installed into setup().
... instead of hiding that behind a function call in setupext.Also always install the test source files -- setting `tests = False` insetup.cfg now only ignores the test data (this is also consistent withthe contents of `matplotlib/tests/__init__.py which is clearly intendedto handle the case where the test source files are installed but not thebaseline images). This is done for simplicity of implementation andalso to make it possibly easier to separately install the baselineimages (as these are now pure "data") in the future.
1 parent7422347 commitc60df5e

File tree

2 files changed

+7
-52
lines changed

2 files changed

+7
-52
lines changed

‎setup.py‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
importos
2424
fromzipfileimportZipFile
2525

26-
fromsetuptoolsimportsetup,Extension
26+
fromsetuptoolsimportsetup,find_packages,Extension
2727
fromsetuptools.command.build_extimportbuild_extasBuildExtCommand
2828
fromsetuptools.command.developimportdevelopasDevelopCommand
2929
fromsetuptools.command.install_libimportinstall_libasInstallLibCommand
@@ -169,12 +169,7 @@ def run(self):
169169
# however, this is needed on Windows to avoid creating infinite subprocesses
170170
# when using multiprocessing.
171171
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.
178173

179174
# If the user just queries for information, don't bother figuring out which
180175
# packages to build or install.
@@ -224,9 +219,6 @@ def run(self):
224219
# Now collect all of the information we need to build all of the
225220
# packages.
226221
forpackageingood_packages:
227-
packages.extend(package.get_packages())
228-
namespace_packages.extend(package.get_namespace_packages())
229-
py_modules.extend(package.get_py_modules())
230222
# Extension modules only get added in build_ext, as numpy will have
231223
# been installed (as setup_requires) at that point.
232224
data=package.get_package_data()
@@ -267,14 +259,14 @@ def run(self):
267259
interfaces and hardcopy output formats.
268260
""",
269261
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"],
274267
# Dummy extension to trigger build_ext, which will swap it out with
275268
# real extensions that can depend on numpy for the build.
276269
ext_modules=[Extension("", [])],
277-
package_dir={"":"lib"},
278270
package_data=package_data,
279271
classifiers=classifiers,
280272

‎setupext.py‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
importos
99
importpathlib
1010
importplatform
11-
importsetuptools
1211
importshlex
1312
importshutil
1413
importsubprocess
@@ -310,30 +309,6 @@ def check(self):
310309
"""
311310
pass
312311

313-
defget_packages(self):
314-
"""
315-
Get a list of package names to add to the configuration.
316-
These are added to the `packages` list passed to
317-
`distutils.setup`.
318-
"""
319-
return []
320-
321-
defget_namespace_packages(self):
322-
"""
323-
Get a list of namespace package names to add to the configuration.
324-
These are added to the `namespace_packages` list passed to
325-
`distutils.setup`.
326-
"""
327-
return []
328-
329-
defget_py_modules(self):
330-
"""
331-
Get a list of top-level modules to add to the configuration.
332-
These are added to the `py_modules` list passed to
333-
`distutils.setup`.
334-
"""
335-
return []
336-
337312
defget_package_data(self):
338313
"""
339314
Get a package data dictionary to add to the configuration.
@@ -485,15 +460,6 @@ class Matplotlib(SetupPackage):
485460
defcheck(self):
486461
returnversioneer.get_version()
487462

488-
defget_packages(self):
489-
returnsetuptools.find_packages("lib",exclude=["*.tests"])
490-
491-
defget_namespace_packages(self):
492-
return ['mpl_toolkits']
493-
494-
defget_py_modules(self):
495-
return ['pylab']
496-
497463
defget_package_data(self):
498464
return {
499465
'matplotlib': [
@@ -525,9 +491,6 @@ class Tests(OptionalPackage):
525491
name="tests"
526492
default_config=False
527493

528-
defget_packages(self):
529-
returnsetuptools.find_packages("lib",include=["*.tests"])
530-
531494
defget_package_data(self):
532495
return {
533496
'matplotlib': [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp