blob: 392fe507c95711952aba9d60da5e7e7850b15ba5 [file] [log] [blame]
Greg Ward13ae1c81999-03-22 14:55:25 +00001"""distutils.command.install
2
3Implements the Distutils 'install' command."""
4
5# created 1999/03/13, Greg Ward
6
Greg Ward3ce77fd2000-03-02 01:49:45 +00007__revision__ = "$Id$"
Greg Ward13ae1c81999-03-22 14:55:25 +00008
9import sys, os, string
Greg Ward865de831999-09-21 18:31:14 +000010from types import *
Greg Ward13ae1c81999-03-22 14:55:25 +000011from distutils.core import Command
Greg Wardff2d9b72000-04-26 02:38:01 +000012from distutils import sysconfig
Greg Ward6a647bb2000-04-27 01:56:38 +000013from distutils.util import write_file, native_path, subst_vars, change_root
Greg Ward4f08e4f2000-02-26 00:49:04 +000014from distutils.errors import DistutilsOptionError
Gregory P. Smith8cb67612000-05-13 01:58:19 +000015from glob import glob
Greg Ward13ae1c81999-03-22 14:55:25 +000016
Greg Warda233d862000-03-22 00:15:45 +000017INSTALL_SCHEMES = {
18 'unix_prefix': {
19 'purelib': '$base/lib/python$py_version_short/site-packages',
20 'platlib': '$platbase/lib/python$py_version_short/site-packages',
21 'scripts': '$base/bin',
22 'data' : '$base/share',
23 },
24 'unix_home': {
25 'purelib': '$base/lib/python',
26 'platlib': '$base/lib/python',
27 'scripts': '$base/bin',
28 'data' : '$base/share',
29 },
30 'nt': {
31 'purelib': '$base',
32 'platlib': '$base',
33 'scripts': '$base\\Scripts',
34 'data' : '$base\\Data',
35 },
36 'mac': {
37 'purelib': '$base:Lib',
38 'platlib': '$base:Mac:PlugIns',
39 'scripts': '$base:Scripts',
40 'data' : '$base:Data',
41 }
42 }
43
44
Greg Ward1993f9a2000-02-18 00:13:53 +000045class install (Command):
Greg Ward13ae1c81999-03-22 14:55:25 +000046
Greg Ward37bc8152000-01-30 18:34:15 +000047 description = "install everything from build directory"
48
Greg Wardbbeceea2000-02-18 00:25:39 +000049 user_options = [
Greg Warda233d862000-03-22 00:15:45 +000050 # Select installation scheme and set base director(y|ies)
51 ('prefix=', None,
52 "installation prefix"),
Greg Wardbbeceea2000-02-18 00:25:39 +000053 ('exec-prefix=', None,
Greg Warda233d862000-03-22 00:15:45 +000054 "(Unix only) prefix for platform-specific files"),
55 ('home=', None,
56 "(Unix only) home directory to install under"),
Greg Ward13ae1c81999-03-22 14:55:25 +000057
Greg Warda233d862000-03-22 00:15:45 +000058 # Or, just set the base director(y|ies)
59 ('install-base=', None,
60 "base installation directory (instead of --prefix or --home)"),
61 ('install-platbase=', None,
62 "base installation directory for platform-specific files " +
63 "(instead of --exec-prefix or --home)"),
Greg Ward6a647bb2000-04-27 01:56:38 +000064 ('root=', None,
65 "install everything relative to this alternate root directory"),
Greg Warda233d862000-03-22 00:15:45 +000066
67 # Or, explicitly set the installation scheme
68 ('install-purelib=', None,
69 "installation directory for pure Python module distributions"),
Greg Ward4f08e4f2000-02-26 00:49:04 +000070 ('install-platlib=', None,
Greg Warda233d862000-03-22 00:15:45 +000071 "installation directory for non-pure module distributions"),
72 ('install-lib=', None,
73 "installation directory for all module distributions " +
74 "(overrides --install-purelib and --install-platlib)"),
75
76 ('install-scripts=', None,
77 "installation directory for Python scripts"),
78 ('install-data=', None,
79 "installation directory for data files"),
Greg Ward4f08e4f2000-02-26 00:49:04 +000080
Gregory P. Smith74ead8f2000-05-12 01:46:47 +000081 # For lazy debuggers who just want to test the install
82 # commands without rerunning "build" all the time
83 ('skip-build', None,
84 "skip rebuilding everything (for testing/debugging)"),
85
Greg Wardbbeceea2000-02-18 00:25:39 +000086 # Where to install documentation (eventually!)
Greg Ward4f08e4f2000-02-26 00:49:04 +000087 #('doc-format=', None, "format of documentation to generate"),
88 #('install-man=', None, "directory for Unix man pages"),
89 #('install-html=', None, "directory for HTML documentation"),
90 #('install-info=', None, "directory for GNU info files"),
Greg Ward13ae1c81999-03-22 14:55:25 +000091
Gregory P. Smith0ec8ef12000-05-13 02:16:45 +000092 ('record=', None,
93 "filename in which to record list of installed files"),
Gregory P. Smith8cb67612000-05-13 01:58:19 +000094 ]
Greg Ward9a337071999-06-08 02:04:36 +000095
Greg Warda4adafd2000-05-20 15:17:09 +000096 # 'sub_commands': a list of commands this command might have to run to
97 # get its work done. Each command is represented as a tuple (method,
98 # command) where 'method' is the name of a method to call that returns
99 # true if 'command' (the sub-command name, a string) needs to be run.
100 # If 'method' is None, assume that 'command' must always be run.
101 sub_commands = [('has_lib', 'install_lib'),
102 ('has_scripts', 'install_scripts'),
103 ('has_data', 'install_data'),
Gregory P. Smithb2e3bb32000-05-12 00:52:23 +0000104 ]
Greg Wardee94c572000-03-29 02:15:57 +0000105
106
Greg Warde01149c2000-02-18 00:35:22 +0000107 def initialize_options (self):
Greg Ward13ae1c81999-03-22 14:55:25 +0000108
Greg Ward790c1102000-03-22 00:51:18 +0000109 # High-level options: these select both an installation base
110 # and scheme.
Greg Ward13ae1c81999-03-22 14:55:25 +0000111 self.prefix = None
112 self.exec_prefix = None
Greg Warda233d862000-03-22 00:15:45 +0000113 self.home = None
114
Greg Ward790c1102000-03-22 00:51:18 +0000115 # These select only the installation base; it's up to the user to
116 # specify the installation scheme (currently, that means supplying
117 # the --install-{platlib,purelib,scripts,data} options).
Greg Warda233d862000-03-22 00:15:45 +0000118 self.install_base = None
119 self.install_platbase = None
Greg Ward6a647bb2000-04-27 01:56:38 +0000120 self.root = None
Greg Ward13ae1c81999-03-22 14:55:25 +0000121
Greg Ward790c1102000-03-22 00:51:18 +0000122 # These options are the actual installation directories; if not
123 # supplied by the user, they are filled in using the installation
124 # scheme implied by prefix/exec-prefix/home and the contents of
125 # that installation scheme.
126 self.install_purelib = None # for pure module distributions
127 self.install_platlib = None # non-pure (dists w/ extensions)
128 self.install_lib = None # set to either purelib or platlib
Greg Warda233d862000-03-22 00:15:45 +0000129 self.install_scripts = None
130 self.install_data = None
Greg Ward13ae1c81999-03-22 14:55:25 +0000131
Greg Ward790c1102000-03-22 00:51:18 +0000132 # These two are for putting non-packagized distributions into their
133 # own directory and creating a .pth file if it makes sense.
134 # 'extra_path' comes from the setup file; 'install_path_file' is
135 # set only if we determine that it makes sense to install a path
136 # file.
Greg Warda233d862000-03-22 00:15:45 +0000137 self.extra_path = None
138 self.install_path_file = 0
139
Gregory P. Smith74ead8f2000-05-12 01:46:47 +0000140 self.skip_build = 0
141
Greg Ward066af102000-03-22 00:30:54 +0000142 # These are only here as a conduit from the 'build' command to the
143 # 'install_*' commands that do the real work. ('build_base' isn't
144 # actually used anywhere, but it might be useful in future.) They
145 # are not user options, because if the user told the install
146 # command where the build directory is, that wouldn't affect the
147 # build command.
148 self.build_base = None
149 self.build_lib = None
150
Greg Ward790c1102000-03-22 00:51:18 +0000151 # Not defined yet because we don't know anything about
152 # documentation yet.
Greg Warda233d862000-03-22 00:15:45 +0000153 #self.install_man = None
154 #self.install_html = None
155 #self.install_info = None
Greg Ward13ae1c81999-03-22 14:55:25 +0000156
Gregory P. Smith8cb67612000-05-13 01:58:19 +0000157 self.record = None
Greg Ward13ae1c81999-03-22 14:55:25 +0000158
Greg Warde01149c2000-02-18 00:35:22 +0000159 def finalize_options (self):
Greg Ward13ae1c81999-03-22 14:55:25 +0000160
Greg Ward790c1102000-03-22 00:51:18 +0000161 # This method (and its pliant slaves, like 'finalize_unix()',
162 # 'finalize_other()', and 'select_scheme()') is where the default
163 # installation directories for modules, extension modules, and
164 # anything else we care to install from a Python module
165 # distribution. Thus, this code makes a pretty important policy
166 # statement about how third-party stuff is added to a Python
167 # installation! Note that the actual work of installation is done
168 # by the relatively simple 'install_*' commands; they just take
169 # their orders from the installation directory options determined
170 # here.
Greg Ward9a337071999-06-08 02:04:36 +0000171
Greg Ward790c1102000-03-22 00:51:18 +0000172 # Check for errors/inconsistencies in the options; first, stuff
173 # that's wrong on any platform.
Greg Ward13ae1c81999-03-22 14:55:25 +0000174
Greg Warda233d862000-03-22 00:15:45 +0000175 if ((self.prefix or self.exec_prefix or self.home) and
176 (self.install_base or self.install_platbase)):
177 raise DistutilsOptionError, \
178 ("must supply either prefix/exec-prefix/home or " +
179 "install-base/install-platbase -- not both")
Greg Ward4f08e4f2000-02-26 00:49:04 +0000180
Greg Ward790c1102000-03-22 00:51:18 +0000181 # Next, stuff that's wrong (or dubious) only on certain platforms.
Greg Ward4f08e4f2000-02-26 00:49:04 +0000182 if os.name == 'posix':
Greg Warda233d862000-03-22 00:15:45 +0000183 if self.home and (self.prefix or self.exec_prefix):
Greg Ward865de831999-09-21 18:31:14 +0000184 raise DistutilsOptionError, \
Greg Warda233d862000-03-22 00:15:45 +0000185 ("must supply either home or prefix/exec-prefix -- " +
186 "not both")
Greg Ward865de831999-09-21 18:31:14 +0000187 else:
Greg Warda233d862000-03-22 00:15:45 +0000188 if self.exec_prefix:
189 self.warn ("exec-prefix option ignored on this platform")
190 self.exec_prefix = None
191 if self.home:
192 self.warn ("home option ignored on this platform")
193 self.home = None
Greg Ward865de831999-09-21 18:31:14 +0000194
Greg Warda233d862000-03-22 00:15:45 +0000195 # Now the interesting logic -- so interesting that we farm it out
196 # to other methods. The goal of these methods is to set the final
197 # values for the install_{lib,scripts,data,...} options, using as
198 # input a heady brew of prefix, exec_prefix, home, install_base,
199 # install_platbase, user-supplied versions of
200 # install_{purelib,platlib,lib,scripts,data,...}, and the
201 # INSTALL_SCHEME dictionary above. Phew!
Greg Ward865de831999-09-21 18:31:14 +0000202
Greg Ward6a647bb2000-04-27 01:56:38 +0000203 self.dump_dirs ("pre-finalize_xxx")
Greg Wardff2d9b72000-04-26 02:38:01 +0000204
Greg Warda233d862000-03-22 00:15:45 +0000205 if os.name == 'posix':
206 self.finalize_unix ()
207 else:
208 self.finalize_other ()
209
Greg Ward6a647bb2000-04-27 01:56:38 +0000210 self.dump_dirs ("post-finalize_xxx()")
Greg Wardff2d9b72000-04-26 02:38:01 +0000211
212 # Expand configuration variables, tilde, etc. in self.install_base
213 # and self.install_platbase -- that way, we can use $base or
214 # $platbase in the other installation directories and not worry
215 # about needing recursive variable expansion (shudder).
216
217 self.config_vars = {'py_version_short': sys.version[0:3],
218 'sys_prefix': sysconfig.PREFIX,
219 'sys_exec_prefix': sysconfig.EXEC_PREFIX,
220 }
221 self.expand_basedirs ()
222
Greg Ward6a647bb2000-04-27 01:56:38 +0000223 self.dump_dirs ("post-expand_basedirs()")
Greg Wardff2d9b72000-04-26 02:38:01 +0000224
225 # Now define config vars for the base directories so we can expand
226 # everything else.
227 self.config_vars['base'] = self.install_base
228 self.config_vars['platbase'] = self.install_platbase
229
Greg Ward6a647bb2000-04-27 01:56:38 +0000230 from pprint import pprint
Greg Wardff2d9b72000-04-26 02:38:01 +0000231 print "config vars:"
232 pprint (self.config_vars)
233
Greg Warda233d862000-03-22 00:15:45 +0000234 # Expand "~" and configuration variables in the installation
235 # directories.
236 self.expand_dirs ()
237
Greg Ward6a647bb2000-04-27 01:56:38 +0000238 self.dump_dirs ("post-expand_dirs()")
Greg Wardff2d9b72000-04-26 02:38:01 +0000239
Greg Warda233d862000-03-22 00:15:45 +0000240 # Pick the actual directory to install all modules to: either
241 # install_purelib or install_platlib, depending on whether this
242 # module distribution is pure or not. Of course, if the user
243 # already specified install_lib, use their selection.
244 if self.install_lib is None:
245 if self.distribution.ext_modules: # has extensions: non-pure
246 self.install_lib = self.install_platlib
247 else:
248 self.install_lib = self.install_purelib
249
250 # Well, we're not actually fully completely finalized yet: we still
251 # have to deal with 'extra_path', which is the hack for allowing
252 # non-packagized module distributions (hello, Numerical Python!) to
253 # get their own directories.
254 self.handle_extra_path ()
255 self.install_libbase = self.install_lib # needed for .pth file
256 self.install_lib = os.path.join (self.install_lib, self.extra_dirs)
Greg Ward865de831999-09-21 18:31:14 +0000257
Greg Ward6a647bb2000-04-27 01:56:38 +0000258 # If a new root directory was supplied, make all the installation
259 # dirs relative to it.
260 if self.root is not None:
261 for name in ('lib', 'purelib', 'platlib', 'scripts', 'data'):
262 attr = "install_" + name
263 new_val = change_root (self.root, getattr (self, attr))
264 setattr (self, attr, new_val)
265
266 self.dump_dirs ("after prepending root")
267
Greg Ward790c1102000-03-22 00:51:18 +0000268 # Find out the build directories, ie. where to install from.
Greg Ward4f08e4f2000-02-26 00:49:04 +0000269 self.set_undefined_options ('build',
270 ('build_base', 'build_base'),
Greg Ward066af102000-03-22 00:30:54 +0000271 ('build_lib', 'build_lib'))
Greg Ward13ae1c81999-03-22 14:55:25 +0000272
273 # Punt on doc directories for now -- after all, we're punting on
274 # documentation completely!
275
Greg Warde01149c2000-02-18 00:35:22 +0000276 # finalize_options ()
Greg Ward13ae1c81999-03-22 14:55:25 +0000277
278
Greg Ward6a647bb2000-04-27 01:56:38 +0000279 # hack for debugging output
280 def dump_dirs (self, msg):
281 from distutils.fancy_getopt import longopt_xlate
282 print msg + ":"
283 for opt in self.user_options:
Gregory P. Smith74ead8f2000-05-12 01:46:47 +0000284 opt_name = opt[0]
285 if opt_name[-1] == "=":
286 opt_name = opt_name[0:-1]
287 opt_name = string.translate (opt_name, longopt_xlate)
Greg Ward6a647bb2000-04-27 01:56:38 +0000288 val = getattr (self, opt_name)
289 print " %s: %s" % (opt_name, val)
290
291
Greg Warda233d862000-03-22 00:15:45 +0000292 def finalize_unix (self):
293
294 if self.install_base is not None or self.install_platbase is not None:
295 if ((self.install_lib is None and
296 self.install_purelib is None and
297 self.install_platlib is None) or
298 self.install_scripts is None or
299 self.install_data is None):
300 raise DistutilsOptionError, \
301 "install-base or install-platbase supplied, but " + \
302 "installation scheme is incomplete"
303
304 return
305
306 if self.home is not None:
307 self.install_base = self.install_platbase = self.home
308 self.select_scheme ("unix_home")
309 else:
310 if self.prefix is None:
311 if self.exec_prefix is not None:
312 raise DistutilsOptionError, \
313 "must not supply exec-prefix without prefix"
314
315 self.prefix = os.path.normpath (sys.prefix)
316 self.exec_prefix = os.path.normpath (sys.exec_prefix)
317 self.install_path_file = 1
318
319 else:
320 if self.exec_prefix is None:
321 self.exec_prefix = self.prefix
322
323
324 # XXX since we don't *know* that a user-supplied prefix really
325 # points to another Python installation, we can't be sure that
326 # writing a .pth file there will actually work -- so we don't
327 # try. That is, we only set 'install_path_file' if the user
328 # didn't supply prefix. There are certainly circumstances
329 # under which we *should* install a .pth file when the user
330 # supplies a prefix, namely when that prefix actually points to
331 # another Python installation. Hmmm.
332
333 self.install_base = self.prefix
334 self.install_platbase = self.exec_prefix
335 self.select_scheme ("unix_prefix")
336
337 # finalize_unix ()
338
339
340 def finalize_other (self): # Windows and Mac OS for now
341
342 if self.prefix is None:
343 self.prefix = os.path.normpath (sys.prefix)
344 self.install_path_file = 1
345
346 # XXX same caveat regarding 'install_path_file' as in
347 # 'finalize_unix()'.
348
349 self.install_base = self.install_platbase = self.prefix
350 try:
351 self.select_scheme (os.name)
352 except KeyError:
353 raise DistutilsPlatformError, \
354 "I don't know how to install stuff on '%s'" % os.name
355
356 # finalize_other ()
357
358
359 def select_scheme (self, name):
Greg Warda233d862000-03-22 00:15:45 +0000360 # it's the caller's problem if they supply a bad name!
361 scheme = INSTALL_SCHEMES[name]
Greg Warda233d862000-03-22 00:15:45 +0000362 for key in ('purelib', 'platlib', 'scripts', 'data'):
Gregory P. Smith17f641c2000-05-12 01:54:50 +0000363 attrname = 'install_' + key
364 if getattr(self, attrname) is None:
365 setattr(self, attrname, scheme[key])
Greg Warda233d862000-03-22 00:15:45 +0000366
367
Greg Wardff2d9b72000-04-26 02:38:01 +0000368 def _expand_attrs (self, attrs):
369 for attr in attrs:
370 val = getattr (self, attr)
371 if val is not None:
372 if os.name == 'posix':
373 val = os.path.expanduser (val)
374 val = subst_vars (val, self.config_vars)
375 setattr (self, attr, val)
376
377
378 def expand_basedirs (self):
379 self._expand_attrs (['install_base',
Greg Ward6a647bb2000-04-27 01:56:38 +0000380 'install_platbase',
381 'root'])
Greg Wardff2d9b72000-04-26 02:38:01 +0000382
Greg Warda233d862000-03-22 00:15:45 +0000383 def expand_dirs (self):
Greg Wardff2d9b72000-04-26 02:38:01 +0000384 self._expand_attrs (['install_purelib',
385 'install_platlib',
386 'install_lib',
387 'install_scripts',
388 'install_data',])
Greg Warda233d862000-03-22 00:15:45 +0000389
390
391 def handle_extra_path (self):
392
393 if self.extra_path is None:
394 self.extra_path = self.distribution.extra_path
395
396 if self.extra_path is not None:
397 if type (self.extra_path) is StringType:
398 self.extra_path = string.split (self.extra_path, ',')
399
400 if len (self.extra_path) == 1:
401 path_file = extra_dirs = self.extra_path[0]
402 elif len (self.extra_path) == 2:
403 (path_file, extra_dirs) = self.extra_path
404 else:
405 raise DistutilsOptionError, \
406 "'extra_path' option must be a list, tuple, or " + \
407 "comma-separated string with 1 or 2 elements"
408
409 # convert to local form in case Unix notation used (as it
410 # should be in setup scripts)
411 extra_dirs = native_path (extra_dirs)
412
413 else:
414 path_file = None
415 extra_dirs = ''
416
417 # XXX should we warn if path_file and not extra_dirs? (in which
418 # case the path file would be harmless but pointless)
419 self.path_file = path_file
420 self.extra_dirs = extra_dirs
421
422 # handle_extra_path ()
423
424
Greg Warda4adafd2000-05-20 15:17:09 +0000425 def get_sub_commands (self):
426 """Return the list of subcommands that we need to run. This is
427 based on the 'subcommands' class attribute: each tuple in that list
428 can name a method that we call to determine if the subcommand needs
429 to be run for the current distribution."""
430 commands = []
431 for (method, cmd_name) in self.sub_commands:
432 if method is not None:
433 method = getattr(self, method)
434 if method is None or method():
435 commands.append(cmd_name)
436 return commands
437
438
Greg Ward13ae1c81999-03-22 14:55:25 +0000439 def run (self):
440
Greg Ward9a337071999-06-08 02:04:36 +0000441 # Obviously have to build before we can install
Gregory P. Smith74ead8f2000-05-12 01:46:47 +0000442 if not self.skip_build:
443 self.run_peer ('build')
Greg Ward9a337071999-06-08 02:04:36 +0000444
Greg Warda4adafd2000-05-20 15:17:09 +0000445 # Run all sub-commands (at least those that need to be run)
446 for cmd_name in self.get_sub_commands():
447 self.run_peer (cmd_name)
Greg Ward865de831999-09-21 18:31:14 +0000448
449 if self.path_file:
450 self.create_path_file ()
Greg Ward13ae1c81999-03-22 14:55:25 +0000451
Gregory P. Smith8cb67612000-05-13 01:58:19 +0000452 # write list of installed files, if requested.
453 if self.record:
454 outputs = self.get_outputs()
Gregory P. Smith7e855ef2000-05-13 02:13:53 +0000455 if self.root: # strip any package prefix
Gregory P. Smith8cb67612000-05-13 01:58:19 +0000456 root_len = len(self.root)
457 for counter in xrange (len (outputs)):
458 outputs[counter] = outputs[counter][root_len:]
459 self.execute(write_file,
Gregory P. Smith0ec8ef12000-05-13 02:16:45 +0000460 (self.record, outputs),
461 "writing list of installed files to '%s'" %
462 self.record)
Gregory P. Smithf9ebf982000-05-13 02:01:22 +0000463
464 normalized_path = map (os.path.normpath, sys.path)
465 if (not (self.path_file and self.install_path_file) and
466 os.path.normpath (self.install_lib) not in normalized_path):
467 self.warn (("modules installed to '%s', which is not in " +
468 "Python's module search path (sys.path) -- " +
469 "you'll have to change the search path yourself") %
470 self.install_lib)
Gregory P. Smith8cb67612000-05-13 01:58:19 +0000471
Greg Ward13ae1c81999-03-22 14:55:25 +0000472 # run ()
473
Greg Ward865de831999-09-21 18:31:14 +0000474
Greg Warda4adafd2000-05-20 15:17:09 +0000475 def has_lib (self):
476 """Return true if the current distribution has any Python
477 modules to install."""
478 return (self.distribution.has_pure_modules() or
479 self.distribution.has_ext_modules())
480
481 def has_scripts (self):
482 return self.distribution.has_scripts()
483
484 def has_data (self):
485 return self.distribution.has_data_files()
486
487
Greg Wardee94c572000-03-29 02:15:57 +0000488 def get_outputs (self):
489 # This command doesn't have any outputs of its own, so just
490 # get the outputs of all its sub-commands.
491 outputs = []
Greg Warda4adafd2000-05-20 15:17:09 +0000492 for cmd_name in self.get_sub_commands():
493 cmd = self.find_peer (cmd_name)
494 outputs.extend (cmd.get_outputs())
Greg Wardee94c572000-03-29 02:15:57 +0000495
496 return outputs
497
498
Greg Wardba38d122000-03-31 02:52:02 +0000499 def get_inputs (self):
500 # XXX gee, this looks familiar ;-(
501 inputs = []
Greg Warda4adafd2000-05-20 15:17:09 +0000502 for cmd_name in self.get_sub_commands():
503 cmd = self.find_peer (cmd_name)
504 inputs.extend (cmd.get_inputs())
Greg Wardba38d122000-03-31 02:52:02 +0000505
506 return inputs
507
508
Greg Ward865de831999-09-21 18:31:14 +0000509 def create_path_file (self):
Greg Warda233d862000-03-22 00:15:45 +0000510 filename = os.path.join (self.install_libbase,
511 self.path_file + ".pth")
512 if self.install_path_file:
513 self.execute (write_file,
514 (filename, [self.extra_dirs]),
515 "creating %s" % filename)
Greg Ward865de831999-09-21 18:31:14 +0000516 else:
Greg Warda233d862000-03-22 00:15:45 +0000517 self.warn (("path file '%s' not created for alternate or custom " +
518 "installation (path files only work with standard " +
519 "installations)") %
520 filename)
Greg Ward865de831999-09-21 18:31:14 +0000521
Greg Ward13ae1c81999-03-22 14:55:25 +0000522# class Install