annotate Lib/distutils/command/build.py @ 70817:dd775b1561ba

Fix markup.
author Georg Brandl <georg@python.org>
date Tue, 14 Jun 2011 21:09:55 +0200
parents 29a3eda89995
children 3e26c9033306
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
11897
017e592c0fd2 Changed '__rcsid__' to '__revision__'.
Greg Ward <gward@python.net>
parents: 11885
diff changeset
5 __revision__ = "$Id$"
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
6
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
7 import sys, os
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
8 from distutils.core import Command
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
9 from distutils.errors import DistutilsOptionError
63136
29a3eda89995 reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen.
Tarek Ziadé <ziade.tarek@gmail.com>
parents: 58559
diff changeset
10 from distutils.util import get_platform
29a3eda89995 reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen.
Tarek Ziadé <ziade.tarek@gmail.com>
parents: 58559
diff changeset
11
12999
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
12
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
13 def show_compilers():
12999
7160b52ca74a Changed so all the help-generating functions are defined, at module-level,
Greg Ward <gward@python.net>
parents: 12997
diff changeset
14 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
15 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
63136
29a3eda89995 reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen.
Tarek Ziadé <ziade.tarek@gmail.com>
parents: 58559
diff changeset
17
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
18 class build(Command):
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
19
11683
47f75a17b103 Added 'description' class attribute to every command class (to help the
Greg Ward <gward@python.net>
parents: 11338
diff changeset
20 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
21
11815
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
22 user_options = [
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
23 ('build-base=', 'b',
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
24 "base directory for build library"),
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
25 ('build-purelib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
26 "build directory for platform-neutral distributions"),
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
27 ('build-platlib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
28 "build directory for platform-specific distributions"),
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
29 ('build-lib=', None,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
30 "build directory for all distribution (defaults to either " +
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
31 "build-purelib or build-platlib"),
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
32 ('build-scripts=', None,
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
33 "build directory for scripts"),
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
34 ('build-temp=', 't',
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
35 "temporary build directory"),
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
36 ('plat-name=', 'p',
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
37 "platform name to build for, if supported "
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
38 "(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
39 ('compiler=', 'c',
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
40 "specify the compiler type"),
11815
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
41 ('debug', 'g',
03902bc0214a Renamed all 'options' class attributes to 'user_options'.
Greg Ward <gward@python.net>
parents: 11813
diff changeset
42 "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
43 ('force', 'f',
12670
2feb9790b404 Fix from Lyle Johnson: add the '--compiler' option.
Gregory P. Smith <greg@mad-scientist.com>
parents: 12318
diff changeset
44 "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
45 ('executable=', 'e',
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
46 "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
47 ]
12997
27f3a18fd296 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
Greg Ward <gward@python.net>
parents: 12869
diff changeset
48
14829
b1f220f636ed Added 'boolean_options' list to support config file parsing.
Greg Ward <gward@python.net>
parents: 14615
diff changeset
49 boolean_options = ['debug', 'force']
b1f220f636ed Added 'boolean_options' list to support config file parsing.
Greg Ward <gward@python.net>
parents: 14615
diff changeset
50
12869
88872791998a Patch from Rene Liebscher: this adds "--help-foo" options to list the
Greg Ward <gward@python.net>
parents: 12783
diff changeset
51 help_options = [
88872791998a Patch from Rene Liebscher: this adds "--help-foo" options to list the
Greg Ward <gward@python.net>
parents: 12783
diff changeset
52 ('help-compiler', None,
12997
27f3a18fd296 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
Greg Ward <gward@python.net>
parents: 12869
diff changeset
53 "list available compilers", show_compilers),
15216
a3975d2811f0 Untabified.
Greg Ward <gward@python.net>
parents: 14948
diff changeset
54 ]
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
55
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
56 def initialize_options(self):
11338
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
57 self.build_base = 'build'
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
58 # 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
59 # (unless overridden by the user or client)
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
60 self.build_purelib = None
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
61 self.build_platlib = None
11338
42941e2eb9d8 Renamed many options to be consistent across commands.
Greg Ward <gward@python.net>
parents: 11301
diff changeset
62 self.build_lib = None
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
63 self.build_temp = None
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
64 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
65 self.compiler = None
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
66 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
67 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
68 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
69 self.executable = None
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
70
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
71 def finalize_options(self):
46370
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
72 if self.plat_name is None:
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
73 self.plat_name = get_platform()
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
74 else:
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
75 # plat-name only supported for windows (other platforms are
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
76 # supported via ./configure flags, if at all). Avoid misleading
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
77 # other platforms.
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
78 if os.name != 'nt':
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
79 raise DistutilsOptionError(
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
80 "--plat-name only supported on Windows (try "
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
81 "using './configure --help' on your platform)")
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
82
2e917b0c8f6e Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44859
diff changeset
83 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
84
44859
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
85 # Make it so Python 2.x and Python 2.x with --with-pydebug don't
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
86 # share the same build directories. Doing so confuses the build
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
87 # process for C modules
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
88 if hasattr(sys, 'gettotalrefcount'):
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
89 plat_specifier += '-pydebug'
feba5d5cac22 Merged revisions 60151-60159,60161-60168,60170,60172-60173,60175 via svnmerge from
Georg Brandl <georg@python.org>
parents: 43026
diff changeset
90
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
91 # 'build_purelib' and 'build_platlib' just default to 'lib' and
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
92 # 'lib.<plat>' under the base build directory. We only use one of
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
93 # them for a given distribution, though --
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
94 if self.build_purelib is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
95 self.build_purelib = os.path.join(self.build_base, 'lib')
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
96 if self.build_platlib is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
97 self.build_platlib = os.path.join(self.build_base,
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
98 'lib' + plat_specifier)
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
99
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
100 # 'build_lib' is the actual directory that we will use for this
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
101 # particular module distribution -- if user didn't supply it, pick
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
102 # 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
103 if self.build_lib is None:
11885
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
104 if self.distribution.ext_modules:
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
105 self.build_lib = self.build_platlib
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
106 else:
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
107 self.build_lib = self.build_purelib
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
108
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
109 # 'build_temp' -- temporary directory for compiler turds,
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
110 # "build/temp.<plat>"
39bb01755079 Build reorg:
Greg Ward <gward@python.net>
parents: 11817
diff changeset
111 if self.build_temp is None:
14948
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
112 self.build_temp = os.path.join(self.build_base,
7acb8bbc215b Standardized whitespace around function calls.
Greg Ward <gward@python.net>
parents: 14940
diff changeset
113 'temp' + plat_specifier)
12744
eeafab8c925b Bastian Kleineidam: the "build_scripts" command and changes
Greg Ward <gward@python.net>
parents: 12743
diff changeset
114 if self.build_scripts is None:
21326
c9adace3c823 Fix for
Michael W. Hudson <mwh@python.net>
parents: 15216
diff changeset
115 self.build_scripts = os.path.join(self.build_base,
c9adace3c823 Fix for
Michael W. Hudson <mwh@python.net>
parents: 15216
diff changeset
116 'scripts-' + sys.version[0:3])
14615
c4d05985c6f3 Tweaked the build temp dir names again.
Greg Ward <gward@python.net>
parents: 14613
diff changeset
117
33266
4e9ecbf47b6b Patch #736857, #736859: Add -e option to build_scripts.
Martin v. Löwis <martin@v.loewis.de>
parents: 26285
diff changeset
118 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
119 self.executable = os.path.normpath(sys.executable)
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
120
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
121 def run(self):
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
122 # 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
123 # - build_py - pure Python modules
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
124 # - build_clib - standalone C libraries
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
125 # - build_ext - Python extensions
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
126 # - build_scripts - (Python) scripts
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
127 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
128 self.run_command(cmd_name)
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
129
63136
29a3eda89995 reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen.
Tarek Ziadé <ziade.tarek@gmail.com>
parents: 58559
diff changeset
130
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
131 # -- Predicates for the sub-command list ---------------------------
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
132
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
133 def has_pure_modules(self):
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
134 return self.distribution.has_pure_modules()
10437
3bc8f53041c0 First checkin of real Distutils command modules.
Greg Ward <gward@python.net>
parents:
diff changeset
135
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
136 def has_c_libraries(self):
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
137 return self.distribution.has_c_libraries()
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
138
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
139 def has_ext_modules(self):
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
140 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
141
43026
a6d3930b5613 General cleanup, raise normalization in Lib/distutils.
Collin Winter <collinw@gmail.com>
parents: 33965
diff changeset
142 def has_scripts(self):
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
143 return self.distribution.has_scripts()
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
144
63136
29a3eda89995 reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen.
Tarek Ziadé <ziade.tarek@gmail.com>
parents: 58559
diff changeset
145
14940
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
146 sub_commands = [('build_py', has_pure_modules),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
147 ('build_clib', has_c_libraries),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
148 ('build_ext', has_ext_modules),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
149 ('build_scripts', has_scripts),
9cea4db41d9f Changed to use the 'sub-commands' machinery:
Greg Ward <gward@python.net>
parents: 14829
diff changeset
150 ]