annotate Lib/distutils/command/build.py @ 58925:eecf1bef052d 2.6

Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........
author Ezio Melotti <ezio.melotti@gmail.com>
date Tue, 16 Feb 2010 23:29:44 +0000
parents a93d2919ea59
children a5229237eb50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
1 """distutils.command.build
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
2
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
3 Implements the Distutils 'build' command."""
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
4
33965
893d46576737 Update compatibility comments to 2.1, corresponding to PEP 291 1.13.
Martin v. Löwis <martin@v.loewis.de>
parents: 33266
diff changeset
5 # This module should be kept compatible with Python 2.1.
26285
42bfc98d295b Add comment to Distutil files about requiring 1.5.2 compatibility, as
Andrew M. Kuchling <amk@amk.ca>
parents: 26210
diff changeset
6
11897
017e592c0fd2 Changed '__rcsid__' to '__revision__'.
Greg Ward <gward@python.net>
parents: 11885
diff changeset
7 __revision__ = "$Id$"
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
8
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
9 import sys, os
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
10 from distutils.core import Command
46331
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
11 from distutils.errors import DistutilsOptionError
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
12 from distutils.util import get_platform
12999
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
13
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
14
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
15 def show_compilers ():
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
16 from distutils.ccompiler import show_compilers
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
17 show_compilers()
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
18
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
19
11813
eaeda4621f7d Renamed all command classes so they're exactly the same as the name of the
Greg Ward <gward@python.net>
parents: 11731
diff changeset
20 class build (Command):
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
21
11683
47f75a17b103 Added 'description' class attribute to every command class (to help the
Greg Ward <gward@python.net>
parents: 11338
diff changeset
22 description = "build everything needed to install"
47f75a17b103 Added 'description' class attribute to every command class (to help the
Greg Ward <gward@python.net>
parents: 11338
diff changeset
23
11815
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
24 user_options = [
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
25 ('build-base=', 'b',
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
26 "base directory for build library"),
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
27 ('build-purelib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
28 "build directory for platform-neutral distributions"),
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
29 ('build-platlib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
30 "build directory for platform-specific distributions"),
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
31 ('build-lib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
32 "build directory for all distribution (defaults to either " +
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
33 "build-purelib or build-platlib"),
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
34 ('build-scripts=', None,
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
35 "build directory for scripts"),
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
36 ('build-temp=', 't',
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
37 "temporary build directory"),
46331
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
38 ('plat-name=', 'p',
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
39 "platform name to build for, if supported "
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
40 "(default: %s)" % get_platform()),
12670
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
41 ('compiler=', 'c',
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
42 "specify the compiler type"),
11815
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
43 ('debug', 'g',
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
44 "compile extensions and libraries with debugging information"),
12314
20a5cbf9fcc0 Added '--force' option -- very clear what it means for building (ignore
Greg Ward <gward@python.net>
parents: 12096
diff changeset
45 ('force', 'f',
12670
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
46 "forcibly build everything (ignore file timestamps)"),
33266
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
47 ('executable=', 'e',
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
48 "specify final destination interpreter path (build.py)"),
11815
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
49 ]
12997
27f3a18fd296 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
Greg Ward <gward@python.net>
parents: 12869
diff changeset
50
14829
b1f220f636ed Added 'boolean_options' list to support config file parsing.
Greg Ward <gward@python.net>
parents: 14615
diff changeset
51 boolean_options = ['debug', 'force']
b1f220f636ed Added 'boolean_options' list to support config file parsing.
Greg Ward <gward@python.net>
parents: 14615
diff changeset
52
12869
88872791998a Patch from Rene Liebscher: this adds "--help-foo" options to list the
Greg Ward <gward@python.net>
parents: 12783
diff changeset
53 help_options = [
88872791998a Patch from Rene Liebscher: this adds "--help-foo" options to list the
Greg Ward <gward@python.net>
parents: 12783
diff changeset
54 ('help-compiler', None,
12997
27f3a18fd296 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
Greg Ward <gward@python.net>
parents: 12869
diff changeset
55 "list available compilers", show_compilers),
15216
a3975d2811f0 Untabified.
Greg Ward <gward@python.net>
parents: 14948
diff changeset
56 ]
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
57
11817
476eaa38e2d6 Renamed 'set_default_options()' to 'initialize_options()', and
Greg Ward <gward@python.net>
parents: 11815
diff changeset
58 def initialize_options (self):
11338
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
59 self.build_base = 'build'
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
60 # these are decided only after 'build_base' has its final value
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
61 # (unless overridden by the user or client)
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
62 self.build_purelib = None
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
63 self.build_platlib = None
11338
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
64 self.build_lib = None
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
65 self.build_temp = None
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
66 self.build_scripts = None
12670
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
67 self.compiler = None
46331
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
68 self.plat_name = None
11731
72ebf91daa05 Added 'debug' option (just there for 'build_ext' and 'build_lib' commands
Greg Ward <gward@python.net>
parents: 11714
diff changeset
69 self.debug = None
12314
20a5cbf9fcc0 Added '--force' option -- very clear what it means for building (ignore
Greg Ward <gward@python.net>
parents: 12096
diff changeset
70 self.force = 0
33266
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
71 self.executable = None
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
72
11817
476eaa38e2d6 Renamed 'set_default_options()' to 'initialize_options()', and
Greg Ward <gward@python.net>
parents: 11815
diff changeset
73 def finalize_options (self):
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
74
46331
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
75 if self.plat_name is None:
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
76 self.plat_name = get_platform()
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
77 else:
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
78 # plat-name only supported for windows (other platforms are
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
79 # supported via ./configure flags, if at all). Avoid misleading
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
80 # other platforms.
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
81 if os.name != 'nt':
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
82 raise DistutilsOptionError(
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
83 "--plat-name only supported on Windows (try "
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
84 "using './configure --help' on your platform)")
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
85
a93d2919ea59 Issue #2513: enable 64bit cross compilation on windows.
Mark Hammond <mhammond@skippinet.com.au>
parents: 44850
diff changeset
86 plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3])
14613
5a512ec8a7ad Include the Python version in the platform-specific build directories:
Greg Ward <gward@python.net>
parents: 12999
diff changeset
87
44850
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
88 # Make it so Python 2.x and Python 2.x with --with-pydebug don't
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
89 # share the same build directories. Doing so confuses the build
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
90 # process for C modules
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
91 if hasattr(sys, 'gettotalrefcount'):
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
92 plat_specifier += '-pydebug'
729495f7b221 #1530959: change distutils build dir for --with-pydebug python builds.
Georg Brandl <georg@python.org>
parents: 33965
diff changeset
93
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
94 # 'build_purelib' and 'build_platlib' just default to 'lib' and
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
95 # 'lib.<plat>' under the base build directory. We only use one of
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
96 # them for a given distribution, though --
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
97 if self.build_purelib is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
98 self.build_purelib = os.path.join(self.build_base, 'lib')
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
99 if self.build_platlib is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
100 self.build_platlib = os.path.join(self.build_base,
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
101 'lib' + plat_specifier)
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
102
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
103 # 'build_lib' is the actual directory that we will use for this
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
104 # particular module distribution -- if user didn't supply it, pick
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
105 # one of 'build_purelib' or 'build_platlib'.
11338
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
106 if self.build_lib is None:
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
107 if self.distribution.ext_modules:
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
108 self.build_lib = self.build_platlib
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
109 else:
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
110 self.build_lib = self.build_purelib
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
111
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
112 # 'build_temp' -- temporary directory for compiler turds,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
113 # "build/temp.<plat>"
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
114 if self.build_temp is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
115 self.build_temp = os.path.join(self.build_base,
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
116 'temp' + plat_specifier)
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
117 if self.build_scripts is None:
21326
c9adace3c823 Fix for
Michael W. Hudson <mwh@python.net>
parents: 15216
diff changeset
118 self.build_scripts = os.path.join(self.build_base,
c9adace3c823 Fix for
Michael W. Hudson <mwh@python.net>
parents: 15216
diff changeset
119 'scripts-' + sys.version[0:3])
14615
c4d05985c6f3 Tweaked the build temp dir names again.
Greg Ward <gward@python.net>
parents: 14613
diff changeset
120
33266
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
121 if self.executable is None:
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
122 self.executable = os.path.normpath(sys.executable)
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
123 # finalize_options ()
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
124
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
125
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
126 def run (self):
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
127
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
128 # Run all relevant sub-commands. This will be some subset of:
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
129 # - build_py - pure Python modules
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
130 # - build_clib - standalone C libraries
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
131 # - build_ext - Python extensions
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
132 # - build_scripts - (Python) scripts
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
133 for cmd_name in self.get_sub_commands():
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
134 self.run_command(cmd_name)
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
135
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
136
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
137 # -- Predicates for the sub-command list ---------------------------
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
138
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
139 def has_pure_modules (self):
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
140 return self.distribution.has_pure_modules()
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
141
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
142 def has_c_libraries (self):
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
143 return self.distribution.has_c_libraries()
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
144
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
145 def has_ext_modules (self):
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
146 return self.distribution.has_ext_modules()
11714
b3223f03c9ea Run the 'build_lib' command before building extensions, if necessary.
Greg Ward <gward@python.net>
parents: 11683
diff changeset
147
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
148 def has_scripts (self):
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
149 return self.distribution.has_scripts()
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
150
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
151
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
152 sub_commands = [('build_py', has_pure_modules),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
153 ('build_clib', has_c_libraries),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
154 ('build_ext', has_ext_modules),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
155 ('build_scripts', has_scripts),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
156 ]
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
157
12743
e878a647e06e Normalized all the end-of-class lines.
Greg Ward <gward@python.net>
parents: 12670
diff changeset
158 # class build