install.py 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. """distutils.command.install
  2. Implements the Distutils 'install' command."""
  3. import sys
  4. import os
  5. from distutils import log
  6. from distutils.core import Command
  7. from distutils.debug import DEBUG
  8. from distutils.sysconfig import get_config_vars
  9. from distutils.errors import DistutilsPlatformError
  10. from distutils.file_util import write_file
  11. from distutils.util import convert_path, subst_vars, change_root
  12. from distutils.util import get_platform
  13. from distutils.errors import DistutilsOptionError
  14. from site import USER_BASE
  15. from site import USER_SITE
  16. HAS_USER_SITE = True
  17. libname = sys.lib
  18. WINDOWS_SCHEME = {
  19. 'purelib': '$base/Lib/site-packages',
  20. 'platlib': '$base/Lib/site-packages',
  21. 'headers': '$base/Include/$dist_name',
  22. 'scripts': '$base/Scripts',
  23. 'data' : '$base',
  24. }
  25. INSTALL_SCHEMES = {
  26. 'unix_prefix': {
  27. 'purelib': '$base/lib/python$py_version_short/site-packages',
  28. 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
  29. 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
  30. 'scripts': '$base/bin',
  31. 'data' : '$base',
  32. },
  33. 'unix_home': {
  34. 'purelib': '$base/lib/python',
  35. 'platlib': '$base/lib/python',
  36. 'headers': '$base/include/python/$dist_name',
  37. 'scripts': '$base/bin',
  38. 'data' : '$base',
  39. },
  40. 'nt': WINDOWS_SCHEME,
  41. }
  42. # user site schemes
  43. if HAS_USER_SITE:
  44. INSTALL_SCHEMES['nt_user'] = {
  45. 'purelib': '$usersite',
  46. 'platlib': '$usersite',
  47. 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
  48. 'scripts': '$userbase/Python$py_version_nodot/Scripts',
  49. 'data' : '$userbase',
  50. }
  51. INSTALL_SCHEMES['unix_user'] = {
  52. 'purelib': '$usersite',
  53. 'platlib': '$usersite',
  54. 'headers':
  55. '$userbase/include/python$py_version_short$abiflags/$dist_name',
  56. 'scripts': '$userbase/bin',
  57. 'data' : '$userbase',
  58. }
  59. # The keys to an installation scheme; if any new types of files are to be
  60. # installed, be sure to add an entry to every installation scheme above,
  61. # and to SCHEME_KEYS here.
  62. SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')
  63. class install(Command):
  64. description = "install everything from build directory"
  65. user_options = [
  66. # Select installation scheme and set base director(y|ies)
  67. ('prefix=', None,
  68. "installation prefix"),
  69. ('exec-prefix=', None,
  70. "(Unix only) prefix for platform-specific files"),
  71. ('home=', None,
  72. "(Unix only) home directory to install under"),
  73. # Or, just set the base director(y|ies)
  74. ('install-base=', None,
  75. "base installation directory (instead of --prefix or --home)"),
  76. ('install-platbase=', None,
  77. "base installation directory for platform-specific files " +
  78. "(instead of --exec-prefix or --home)"),
  79. ('root=', None,
  80. "install everything relative to this alternate root directory"),
  81. # Or, explicitly set the installation scheme
  82. ('install-purelib=', None,
  83. "installation directory for pure Python module distributions"),
  84. ('install-platlib=', None,
  85. "installation directory for non-pure module distributions"),
  86. ('install-lib=', None,
  87. "installation directory for all module distributions " +
  88. "(overrides --install-purelib and --install-platlib)"),
  89. ('install-headers=', None,
  90. "installation directory for C/C++ headers"),
  91. ('install-scripts=', None,
  92. "installation directory for Python scripts"),
  93. ('install-data=', None,
  94. "installation directory for data files"),
  95. # Byte-compilation options -- see install_lib.py for details, as
  96. # these are duplicated from there (but only install_lib does
  97. # anything with them).
  98. ('compile', 'c', "compile .py to .pyc [default]"),
  99. ('no-compile', None, "don't compile .py files"),
  100. ('optimize=', 'O',
  101. "also compile with optimization: -O1 for \"python -O\", "
  102. "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
  103. # Miscellaneous control options
  104. ('force', 'f',
  105. "force installation (overwrite any existing files)"),
  106. ('skip-build', None,
  107. "skip rebuilding everything (for testing/debugging)"),
  108. # Where to install documentation (eventually!)
  109. #('doc-format=', None, "format of documentation to generate"),
  110. #('install-man=', None, "directory for Unix man pages"),
  111. #('install-html=', None, "directory for HTML documentation"),
  112. #('install-info=', None, "directory for GNU info files"),
  113. ('record=', None,
  114. "filename in which to record list of installed files"),
  115. ]
  116. boolean_options = ['compile', 'force', 'skip-build']
  117. if HAS_USER_SITE:
  118. user_options.append(('user', None,
  119. "install in user site-package '%s'" % USER_SITE))
  120. boolean_options.append('user')
  121. negative_opt = {'no-compile' : 'compile'}
  122. def initialize_options(self):
  123. """Initializes options."""
  124. # High-level options: these select both an installation base
  125. # and scheme.
  126. self.prefix = None
  127. self.exec_prefix = None
  128. self.home = None
  129. self.user = 0
  130. # These select only the installation base; it's up to the user to
  131. # specify the installation scheme (currently, that means supplying
  132. # the --install-{platlib,purelib,scripts,data} options).
  133. self.install_base = None
  134. self.install_platbase = None
  135. self.root = None
  136. # These options are the actual installation directories; if not
  137. # supplied by the user, they are filled in using the installation
  138. # scheme implied by prefix/exec-prefix/home and the contents of
  139. # that installation scheme.
  140. self.install_purelib = None # for pure module distributions
  141. self.install_platlib = None # non-pure (dists w/ extensions)
  142. self.install_headers = None # for C/C++ headers
  143. self.install_lib = None # set to either purelib or platlib
  144. self.install_scripts = None
  145. self.install_data = None
  146. self.install_userbase = USER_BASE
  147. self.install_usersite = USER_SITE
  148. self.compile = None
  149. self.optimize = None
  150. # These two are for putting non-packagized distributions into their
  151. # own directory and creating a .pth file if it makes sense.
  152. # 'extra_path' comes from the setup file; 'install_path_file' can
  153. # be turned off if it makes no sense to install a .pth file. (But
  154. # better to install it uselessly than to guess wrong and not
  155. # install it when it's necessary and would be used!) Currently,
  156. # 'install_path_file' is always true unless some outsider meddles
  157. # with it.
  158. self.extra_path = None
  159. self.install_path_file = 1
  160. # 'force' forces installation, even if target files are not
  161. # out-of-date. 'skip_build' skips running the "build" command,
  162. # handy if you know it's not necessary. 'warn_dir' (which is *not*
  163. # a user option, it's just there so the bdist_* commands can turn
  164. # it off) determines whether we warn about installing to a
  165. # directory not in sys.path.
  166. self.force = 0
  167. self.skip_build = 0
  168. self.warn_dir = 1
  169. # These are only here as a conduit from the 'build' command to the
  170. # 'install_*' commands that do the real work. ('build_base' isn't
  171. # actually used anywhere, but it might be useful in future.) They
  172. # are not user options, because if the user told the install
  173. # command where the build directory is, that wouldn't affect the
  174. # build command.
  175. self.build_base = None
  176. self.build_lib = None
  177. # Not defined yet because we don't know anything about
  178. # documentation yet.
  179. #self.install_man = None
  180. #self.install_html = None
  181. #self.install_info = None
  182. self.record = None
  183. # -- Option finalizing methods -------------------------------------
  184. # (This is rather more involved than for most commands,
  185. # because this is where the policy for installing third-
  186. # party Python modules on various platforms given a wide
  187. # array of user input is decided. Yes, it's quite complex!)
  188. def finalize_options(self):
  189. """Finalizes options."""
  190. # This method (and its pliant slaves, like 'finalize_unix()',
  191. # 'finalize_other()', and 'select_scheme()') is where the default
  192. # installation directories for modules, extension modules, and
  193. # anything else we care to install from a Python module
  194. # distribution. Thus, this code makes a pretty important policy
  195. # statement about how third-party stuff is added to a Python
  196. # installation! Note that the actual work of installation is done
  197. # by the relatively simple 'install_*' commands; they just take
  198. # their orders from the installation directory options determined
  199. # here.
  200. # Check for errors/inconsistencies in the options; first, stuff
  201. # that's wrong on any platform.
  202. if ((self.prefix or self.exec_prefix or self.home) and
  203. (self.install_base or self.install_platbase)):
  204. raise DistutilsOptionError(
  205. "must supply either prefix/exec-prefix/home or " +
  206. "install-base/install-platbase -- not both")
  207. if self.home and (self.prefix or self.exec_prefix):
  208. raise DistutilsOptionError(
  209. "must supply either home or prefix/exec-prefix -- not both")
  210. if self.user and (self.prefix or self.exec_prefix or self.home or
  211. self.install_base or self.install_platbase):
  212. raise DistutilsOptionError("can't combine user with prefix, "
  213. "exec_prefix/home, or install_(plat)base")
  214. # Next, stuff that's wrong (or dubious) only on certain platforms.
  215. if os.name != "posix":
  216. if self.exec_prefix:
  217. self.warn("exec-prefix option ignored on this platform")
  218. self.exec_prefix = None
  219. # Now the interesting logic -- so interesting that we farm it out
  220. # to other methods. The goal of these methods is to set the final
  221. # values for the install_{lib,scripts,data,...} options, using as
  222. # input a heady brew of prefix, exec_prefix, home, install_base,
  223. # install_platbase, user-supplied versions of
  224. # install_{purelib,platlib,lib,scripts,data,...}, and the
  225. # INSTALL_SCHEME dictionary above. Phew!
  226. self.dump_dirs("pre-finalize_{unix,other}")
  227. if os.name == 'posix':
  228. self.finalize_unix()
  229. else:
  230. self.finalize_other()
  231. self.dump_dirs("post-finalize_{unix,other}()")
  232. # Expand configuration variables, tilde, etc. in self.install_base
  233. # and self.install_platbase -- that way, we can use $base or
  234. # $platbase in the other installation directories and not worry
  235. # about needing recursive variable expansion (shudder).
  236. py_version = sys.version.split()[0]
  237. (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
  238. try:
  239. abiflags = sys.abiflags
  240. except AttributeError:
  241. # sys.abiflags may not be defined on all platforms.
  242. abiflags = ''
  243. self.config_vars = {'dist_name': self.distribution.get_name(),
  244. 'dist_version': self.distribution.get_version(),
  245. 'dist_fullname': self.distribution.get_fullname(),
  246. 'py_version': py_version,
  247. 'py_version_short': py_version[0:3],
  248. 'py_version_nodot': py_version[0] + py_version[2],
  249. 'sys_prefix': prefix,
  250. 'prefix': prefix,
  251. 'sys_exec_prefix': exec_prefix,
  252. 'exec_prefix': exec_prefix,
  253. 'abiflags': abiflags,
  254. }
  255. if HAS_USER_SITE:
  256. self.config_vars['userbase'] = self.install_userbase
  257. self.config_vars['usersite'] = self.install_usersite
  258. self.expand_basedirs()
  259. self.dump_dirs("post-expand_basedirs()")
  260. # Now define config vars for the base directories so we can expand
  261. # everything else.
  262. self.config_vars['base'] = self.install_base
  263. self.config_vars['platbase'] = self.install_platbase
  264. if DEBUG:
  265. from pprint import pprint
  266. print("config vars:")
  267. pprint(self.config_vars)
  268. # Expand "~" and configuration variables in the installation
  269. # directories.
  270. self.expand_dirs()
  271. self.dump_dirs("post-expand_dirs()")
  272. # Create directories in the home dir:
  273. if self.user:
  274. self.create_home_path()
  275. # Pick the actual directory to install all modules to: either
  276. # install_purelib or install_platlib, depending on whether this
  277. # module distribution is pure or not. Of course, if the user
  278. # already specified install_lib, use their selection.
  279. if self.install_lib is None:
  280. if self.distribution.ext_modules: # has extensions: non-pure
  281. self.install_lib = self.install_platlib
  282. else:
  283. self.install_lib = self.install_purelib
  284. # Convert directories from Unix /-separated syntax to the local
  285. # convention.
  286. self.convert_paths('lib', 'purelib', 'platlib',
  287. 'scripts', 'data', 'headers',
  288. 'userbase', 'usersite')
  289. # Well, we're not actually fully completely finalized yet: we still
  290. # have to deal with 'extra_path', which is the hack for allowing
  291. # non-packagized module distributions (hello, Numerical Python!) to
  292. # get their own directories.
  293. self.handle_extra_path()
  294. self.install_libbase = self.install_lib # needed for .pth file
  295. self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
  296. # If a new root directory was supplied, make all the installation
  297. # dirs relative to it.
  298. if self.root is not None:
  299. self.change_roots('libbase', 'lib', 'purelib', 'platlib',
  300. 'scripts', 'data', 'headers')
  301. self.dump_dirs("after prepending root")
  302. # Find out the build directories, ie. where to install from.
  303. self.set_undefined_options('build',
  304. ('build_base', 'build_base'),
  305. ('build_lib', 'build_lib'))
  306. # Punt on doc directories for now -- after all, we're punting on
  307. # documentation completely!
  308. def dump_dirs(self, msg):
  309. """Dumps the list of user options."""
  310. if not DEBUG:
  311. return
  312. from distutils.fancy_getopt import longopt_xlate
  313. log.debug(msg + ":")
  314. for opt in self.user_options:
  315. opt_name = opt[0]
  316. if opt_name[-1] == "=":
  317. opt_name = opt_name[0:-1]
  318. if opt_name in self.negative_opt:
  319. opt_name = self.negative_opt[opt_name]
  320. opt_name = opt_name.translate(longopt_xlate)
  321. val = not getattr(self, opt_name)
  322. else:
  323. opt_name = opt_name.translate(longopt_xlate)
  324. val = getattr(self, opt_name)
  325. log.debug(" %s: %s" % (opt_name, val))
  326. def finalize_unix(self):
  327. """Finalizes options for posix platforms."""
  328. if self.install_base is not None or self.install_platbase is not None:
  329. if ((self.install_lib is None and
  330. self.install_purelib is None and
  331. self.install_platlib is None) or
  332. self.install_headers is None or
  333. self.install_scripts is None or
  334. self.install_data is None):
  335. raise DistutilsOptionError(
  336. "install-base or install-platbase supplied, but "
  337. "installation scheme is incomplete")
  338. return
  339. if self.user:
  340. if self.install_userbase is None:
  341. raise DistutilsPlatformError(
  342. "User base directory is not specified")
  343. self.install_base = self.install_platbase = self.install_userbase
  344. self.select_scheme("unix_user")
  345. elif self.home is not None:
  346. self.install_base = self.install_platbase = self.home
  347. self.select_scheme("unix_home")
  348. else:
  349. if self.prefix is None:
  350. if self.exec_prefix is not None:
  351. raise DistutilsOptionError(
  352. "must not supply exec-prefix without prefix")
  353. self.prefix = os.path.normpath(sys.prefix)
  354. self.exec_prefix = os.path.normpath(sys.exec_prefix)
  355. else:
  356. if self.exec_prefix is None:
  357. self.exec_prefix = self.prefix
  358. self.install_base = self.prefix
  359. self.install_platbase = self.exec_prefix
  360. self.select_scheme("unix_prefix")
  361. def finalize_other(self):
  362. """Finalizes options for non-posix platforms"""
  363. if self.user:
  364. if self.install_userbase is None:
  365. raise DistutilsPlatformError(
  366. "User base directory is not specified")
  367. self.install_base = self.install_platbase = self.install_userbase
  368. self.select_scheme(os.name + "_user")
  369. elif self.home is not None:
  370. self.install_base = self.install_platbase = self.home
  371. self.select_scheme("unix_home")
  372. else:
  373. if self.prefix is None:
  374. self.prefix = os.path.normpath(sys.prefix)
  375. self.install_base = self.install_platbase = self.prefix
  376. try:
  377. self.select_scheme(os.name)
  378. except KeyError:
  379. raise DistutilsPlatformError(
  380. "I don't know how to install stuff on '%s'" % os.name)
  381. def select_scheme(self, name):
  382. """Sets the install directories by applying the install schemes."""
  383. # it's the caller's problem if they supply a bad name!
  384. scheme = INSTALL_SCHEMES[name]
  385. for key in SCHEME_KEYS:
  386. attrname = 'install_' + key
  387. if getattr(self, attrname) is None:
  388. setattr(self, attrname, scheme[key])
  389. def _expand_attrs(self, attrs):
  390. for attr in attrs:
  391. val = getattr(self, attr)
  392. if val is not None:
  393. if os.name == 'posix' or os.name == 'nt':
  394. val = os.path.expanduser(val)
  395. val = subst_vars(val, self.config_vars)
  396. setattr(self, attr, val)
  397. def expand_basedirs(self):
  398. """Calls `os.path.expanduser` on install_base, install_platbase and
  399. root."""
  400. self._expand_attrs(['install_base', 'install_platbase', 'root'])
  401. def expand_dirs(self):
  402. """Calls `os.path.expanduser` on install dirs."""
  403. self._expand_attrs(['install_purelib', 'install_platlib',
  404. 'install_lib', 'install_headers',
  405. 'install_scripts', 'install_data',])
  406. def convert_paths(self, *names):
  407. """Call `convert_path` over `names`."""
  408. for name in names:
  409. attr = "install_" + name
  410. setattr(self, attr, convert_path(getattr(self, attr)))
  411. def handle_extra_path(self):
  412. """Set `path_file` and `extra_dirs` using `extra_path`."""
  413. if self.extra_path is None:
  414. self.extra_path = self.distribution.extra_path
  415. if self.extra_path is not None:
  416. if isinstance(self.extra_path, str):
  417. self.extra_path = self.extra_path.split(',')
  418. if len(self.extra_path) == 1:
  419. path_file = extra_dirs = self.extra_path[0]
  420. elif len(self.extra_path) == 2:
  421. path_file, extra_dirs = self.extra_path
  422. else:
  423. raise DistutilsOptionError(
  424. "'extra_path' option must be a list, tuple, or "
  425. "comma-separated string with 1 or 2 elements")
  426. # convert to local form in case Unix notation used (as it
  427. # should be in setup scripts)
  428. extra_dirs = convert_path(extra_dirs)
  429. else:
  430. path_file = None
  431. extra_dirs = ''
  432. # XXX should we warn if path_file and not extra_dirs? (in which
  433. # case the path file would be harmless but pointless)
  434. self.path_file = path_file
  435. self.extra_dirs = extra_dirs
  436. def change_roots(self, *names):
  437. """Change the install directories pointed by name using root."""
  438. for name in names:
  439. attr = "install_" + name
  440. setattr(self, attr, change_root(self.root, getattr(self, attr)))
  441. def create_home_path(self):
  442. """Create directories under ~."""
  443. if not self.user:
  444. return
  445. home = convert_path(os.path.expanduser("~"))
  446. for name, path in self.config_vars.items():
  447. if path.startswith(home) and not os.path.isdir(path):
  448. self.debug_print("os.makedirs('%s', 0o700)" % path)
  449. os.makedirs(path, 0o700)
  450. # -- Command execution methods -------------------------------------
  451. def run(self):
  452. """Runs the command."""
  453. # Obviously have to build before we can install
  454. if not self.skip_build:
  455. self.run_command('build')
  456. # If we built for any other platform, we can't install.
  457. build_plat = self.distribution.get_command_obj('build').plat_name
  458. # check warn_dir - it is a clue that the 'install' is happening
  459. # internally, and not to sys.path, so we don't check the platform
  460. # matches what we are running.
  461. if self.warn_dir and build_plat != get_platform():
  462. raise DistutilsPlatformError("Can't install when "
  463. "cross-compiling")
  464. # Run all sub-commands (at least those that need to be run)
  465. for cmd_name in self.get_sub_commands():
  466. self.run_command(cmd_name)
  467. if self.path_file:
  468. self.create_path_file()
  469. # write list of installed files, if requested.
  470. if self.record:
  471. outputs = self.get_outputs()
  472. if self.root: # strip any package prefix
  473. root_len = len(self.root)
  474. for counter in range(len(outputs)):
  475. outputs[counter] = outputs[counter][root_len:]
  476. self.execute(write_file,
  477. (self.record, outputs),
  478. "writing list of installed files to '%s'" %
  479. self.record)
  480. sys_path = map(os.path.normpath, sys.path)
  481. sys_path = map(os.path.normcase, sys_path)
  482. install_lib = os.path.normcase(os.path.normpath(self.install_lib))
  483. if (self.warn_dir and
  484. not (self.path_file and self.install_path_file) and
  485. install_lib not in sys_path):
  486. log.debug(("modules installed to '%s', which is not in "
  487. "Python's module search path (sys.path) -- "
  488. "you'll have to change the search path yourself"),
  489. self.install_lib)
  490. def create_path_file(self):
  491. """Creates the .pth file"""
  492. filename = os.path.join(self.install_libbase,
  493. self.path_file + ".pth")
  494. if self.install_path_file:
  495. self.execute(write_file,
  496. (filename, [self.extra_dirs]),
  497. "creating %s" % filename)
  498. else:
  499. self.warn("path file '%s' not created" % filename)
  500. # -- Reporting methods ---------------------------------------------
  501. def get_outputs(self):
  502. """Assembles the outputs of all the sub-commands."""
  503. outputs = []
  504. for cmd_name in self.get_sub_commands():
  505. cmd = self.get_finalized_command(cmd_name)
  506. # Add the contents of cmd.get_outputs(), ensuring
  507. # that outputs doesn't contain duplicate entries
  508. for filename in cmd.get_outputs():
  509. if filename not in outputs:
  510. outputs.append(filename)
  511. if self.path_file and self.install_path_file:
  512. outputs.append(os.path.join(self.install_libbase,
  513. self.path_file + ".pth"))
  514. return outputs
  515. def get_inputs(self):
  516. """Returns the inputs of all the sub-commands"""
  517. # XXX gee, this looks familiar ;-(
  518. inputs = []
  519. for cmd_name in self.get_sub_commands():
  520. cmd = self.get_finalized_command(cmd_name)
  521. inputs.extend(cmd.get_inputs())
  522. return inputs
  523. # -- Predicates for sub-command list -------------------------------
  524. def has_lib(self):
  525. """Returns true if the current distribution has any Python
  526. modules to install."""
  527. return (self.distribution.has_pure_modules() or
  528. self.distribution.has_ext_modules())
  529. def has_headers(self):
  530. """Returns true if the current distribution has any headers to
  531. install."""
  532. return self.distribution.has_headers()
  533. def has_scripts(self):
  534. """Returns true if the current distribution has any scripts to.
  535. install."""
  536. return self.distribution.has_scripts()
  537. def has_data(self):
  538. """Returns true if the current distribution has any data to.
  539. install."""
  540. return self.distribution.has_data_files()
  541. # 'sub_commands': a list of commands this command might have to run to
  542. # get its work done. See cmd.py for more info.
  543. sub_commands = [('install_lib', has_lib),
  544. ('install_headers', has_headers),
  545. ('install_scripts', has_scripts),
  546. ('install_data', has_data),
  547. ('install_egg_info', lambda self:True),
  548. ]