[Python-checkins] distutils2: Rename the install command from "install" to "instal_dist", to avoid any

tarek.ziade python-checkins at python.org
Sat Oct 23 22:36:31 CEST 2010


tarek.ziade pushed 1aaa03e0089e to distutils2:
http://hg.python.org/distutils2/rev/1aaa03e0089e
changeset: 773:1aaa03e0089e
parent: 770:dcd2f13f6053
user: Alexis Metaireau <ametaireau at gmail.com>
date: Sun Oct 17 05:15:00 2010 +0100
summary: Rename the install command from "install" to "instal_dist", to avoid any
files: distutils2/command/bdist_dumb.py, distutils2/command/bdist_msi.py, distutils2/command/cmd.py, distutils2/command/install.py, distutils2/command/install_data.py, distutils2/command/install_dist.py, distutils2/command/install_distinfo.py, distutils2/command/install_headers.py, distutils2/command/install_lib.py, distutils2/command/install_scripts.py, distutils2/dist.py, distutils2/tests/test_command_check.py, distutils2/tests/test_command_install.py, distutils2/tests/test_command_install_distinfo.py, distutils2/tests/test_command_install_scripts.py
diff --git a/distutils2/command/bdist_dumb.py b/distutils2/command/bdist_dumb.py
--- a/distutils2/command/bdist_dumb.py
+++ b/distutils2/command/bdist_dumb.py
@@ -82,13 +82,13 @@
 if not self.skip_build:
 self.run_command('build')
 
- install = self.get_reinitialized_command('install', reinit_subcommands=1)
+ install = self.get_reinitialized_command('install_dist', reinit_subcommands=1)
 install.root = self.bdist_dir
 install.skip_build = self.skip_build
 install.warn_dir = 0
 
 log.info("installing to %s" % self.bdist_dir)
- self.run_command('install')
+ self.run_command('install_dist')
 
 # And make an archive relative to the root of the
 # pseudo-installation tree.
diff --git a/distutils2/command/bdist_msi.py b/distutils2/command/bdist_msi.py
--- a/distutils2/command/bdist_msi.py
+++ b/distutils2/command/bdist_msi.py
@@ -174,7 +174,7 @@
 if not self.skip_build:
 self.run_command('build')
 
- install = self.get_reinitialized_command('install', reinit_subcommands=1)
+ install = self.get_reinitialized_command('install_dist', reinit_subcommands=1)
 install.prefix = self.bdist_dir
 install.skip_build = self.skip_build
 install.warn_dir = 0
diff --git a/distutils2/command/cmd.py b/distutils2/command/cmd.py
--- a/distutils2/command/cmd.py
+++ b/distutils2/command/cmd.py
@@ -35,7 +35,7 @@
 """
 
 # 'sub_commands' formalizes the notion of a "family" of commands,
- # eg. "install" as the parent with sub-commands "install_lib",
+ # eg. "install_dist" as the parent with sub-commands "install_lib",
 # "install_headers", etc. The parent of a family of commands
 # defines 'sub_commands' as a class attribute; it's a list of
 # (command_name : string, predicate : unbound_method | string | None)
@@ -47,7 +47,7 @@
 #
 # 'sub_commands' is usually defined at the *end* of a class, because
 # predicates can be unbound methods, so they must already have been
- # defined. The canonical example is the "install" command.
+ # defined. The canonical example is the "install_dist" command.
 sub_commands = []
 
 # Pre and post command hooks are run just before or just after the command
@@ -478,7 +478,7 @@
 self.outfiles = []
 
 def _install_dir_from(self, dirname):
- self.set_undefined_options('install', (dirname, 'install_dir'))
+ self.set_undefined_options('install_dist', (dirname, 'install_dir'))
 
 def _copy_files(self, filelist):
 self.outfiles = []
diff --git a/distutils2/command/install_data.py b/distutils2/command/install_data.py
--- a/distutils2/command/install_data.py
+++ b/distutils2/command/install_data.py
@@ -34,7 +34,7 @@
 self.warn_dir = 1
 
 def finalize_options(self):
- self.set_undefined_options('install',
+ self.set_undefined_options('install_dist',
 ('install_data', 'install_dir'),
 'root', 'force')
 
diff --git a/distutils2/command/install.py b/distutils2/command/install_dist.py
rename from distutils2/command/install.py
rename to distutils2/command/install_dist.py
--- a/distutils2/command/install.py
+++ b/distutils2/command/install_dist.py
@@ -1,6 +1,6 @@
 """distutils.command.install
 
-Implements the Distutils 'install' command."""
+Implements the Distutils 'install_dist' command."""
 
 
 import sys
@@ -24,7 +24,7 @@
 HAS_USER_SITE = True
 
 
-class install(Command):
+class install_dist(Command):
 
 description = "install everything from build directory"
 
@@ -513,7 +513,7 @@
 self.run_command('build')
 # If we built for any other platform, we can't install.
 build_plat = self.distribution.get_command_obj('build').plat_name
- # check warn_dir - it is a clue that the 'install' is happening
+ # check warn_dir - it is a clue that the 'install_dist' is happening
 # internally, and not to sys.path, so we don't check the platform
 # matches what we are running.
 if self.warn_dir and build_plat != get_platform():
diff --git a/distutils2/command/install_distinfo.py b/distutils2/command/install_distinfo.py
--- a/distutils2/command/install_distinfo.py
+++ b/distutils2/command/install_distinfo.py
@@ -7,7 +7,7 @@
 This module implements the ``install_distinfo`` command that creates the
 ``.dist-info`` directory for the distribution, as specified in :pep:`376`.
 Usually, you do not have to call this command directly, it gets called
-automatically by the ``install`` command.
+automatically by the ``install_dist`` command.
 """
 
 # This file was created from the code for the former command install_egg_info
@@ -52,7 +52,7 @@
 self.no_record = None
 
 def finalize_options(self):
- self.set_undefined_options('install',
+ self.set_undefined_options('install_dist',
 'installer', 'requested', 'no_record')
 
 self.set_undefined_options('install_lib',
@@ -122,7 +122,7 @@
 lineterminator=os.linesep,
 quotechar='"')
 
- install = self.get_finalized_command('install')
+ install = self.get_finalized_command('install_dist')
 
 for fpath in install.get_outputs():
 if fpath.endswith('.pyc') or fpath.endswith('.pyo'):
diff --git a/distutils2/command/install_headers.py b/distutils2/command/install_headers.py
--- a/distutils2/command/install_headers.py
+++ b/distutils2/command/install_headers.py
@@ -26,7 +26,7 @@
 self.outfiles = []
 
 def finalize_options(self):
- self.set_undefined_options('install',
+ self.set_undefined_options('install_dist',
 ('install_headers', 'install_dir'),
 'force')
 
diff --git a/distutils2/command/install_lib.py b/distutils2/command/install_lib.py
--- a/distutils2/command/install_lib.py
+++ b/distutils2/command/install_lib.py
@@ -52,7 +52,7 @@
 negative_opt = {'no-compile' : 'compile'}
 
 def initialize_options(self):
- # let the 'install' command dictate our installation directory
+ # let the 'install_dist' command dictate our installation directory
 self.install_dir = None
 self.build_dir = None
 self.force = 0
@@ -62,9 +62,9 @@
 
 def finalize_options(self):
 # Get all the information we need to install pure Python modules
- # from the umbrella 'install' command -- build (source) directory,
+ # from the umbrella 'install_dist' command -- build (source) directory,
 # install (target) directory, and whether to compile .py files.
- self.set_undefined_options('install',
+ self.set_undefined_options('install_dist',
 ('build_lib', 'build_dir'),
 ('install_lib', 'install_dir'),
 'force', 'compile', 'optimize', 'skip_build')
@@ -121,11 +121,11 @@
 
 from distutils2.util import byte_compile
 
- # Get the "--root" directory supplied to the "install" command,
+ # Get the "--root" directory supplied to the "install_dist" command,
 # and use it as a prefix to strip off the purported filename
 # encoded in bytecode files. This is far from complete, but it
 # should at least generate usable bytecode in RPM distributions.
- install_root = self.get_finalized_command('install').root
+ install_root = self.get_finalized_command('install_dist').root
 
 if self.compile:
 byte_compile(files, optimize=0,
diff --git a/distutils2/command/install_scripts.py b/distutils2/command/install_scripts.py
--- a/distutils2/command/install_scripts.py
+++ b/distutils2/command/install_scripts.py
@@ -33,7 +33,7 @@
 
 def finalize_options (self):
 self.set_undefined_options('build', ('build_scripts', 'build_dir'))
- self.set_undefined_options('install',
+ self.set_undefined_options('install_dist',
 ('install_scripts', 'install_dir'),
 'force', 'skip_build')
 
diff --git a/distutils2/dist.py b/distutils2/dist.py
--- a/distutils2/dist.py
+++ b/distutils2/dist.py
@@ -813,7 +813,7 @@
 'command' should be a command name (string) or command object. If
 'reinit_subcommands' is true, also reinitializes the command's
 sub-commands, as declared by the 'sub_commands' class attribute (if
- it has one). See the "install" command for an example. Only
+ it has one). See the "install_dist" command for an example. Only
 reinitializes the sub-commands that actually matter, ie. those
 whose test predicates return true.
 
diff --git a/distutils2/tests/test_command_check.py b/distutils2/tests/test_command_check.py
--- a/distutils2/tests/test_command_check.py
+++ b/distutils2/tests/test_command_check.py
@@ -69,7 +69,7 @@
 
 def test_check_hooks(self):
 pkg_info, dist = self.create_dist()
- dist.command_options['install'] = {
+ dist.command_options['install_dist'] = {
 'pre_hook': ('file', {"a": 'some.nonextistant.hook.ghrrraarrhll'}),
 }
 cmd = check(dist)
diff --git a/distutils2/tests/test_command_install.py b/distutils2/tests/test_command_install.py
--- a/distutils2/tests/test_command_install.py
+++ b/distutils2/tests/test_command_install.py
@@ -184,7 +184,7 @@
 
 dist = Distribution()
 cmd = install(dist)
- dist.command_obj['install'] = cmd
+ dist.command_obj['install_dist'] = cmd
 cmd.root = install_dir
 cmd.record = os.path.join(pkgdir, 'RECORD')
 cmd.ensure_finalized()
diff --git a/distutils2/tests/test_command_install_distinfo.py b/distutils2/tests/test_command_install_distinfo.py
--- a/distutils2/tests/test_command_install_distinfo.py
+++ b/distutils2/tests/test_command_install_distinfo.py
@@ -45,7 +45,7 @@
 install_dir = self.mkdtemp()
 
 install = DummyInstallCmd(dist)
- dist.command_obj['install'] = install
+ dist.command_obj['install_dist'] = install
 
 cmd = install_distinfo(dist)
 dist.command_obj['install_distinfo'] = cmd
@@ -73,7 +73,7 @@
 install_dir = self.mkdtemp()
 
 install = DummyInstallCmd(dist)
- dist.command_obj['install'] = install
+ dist.command_obj['install_dist'] = install
 
 cmd = install_distinfo(dist)
 dist.command_obj['install_distinfo'] = cmd
@@ -94,7 +94,7 @@
 install_dir = self.mkdtemp()
 
 install = DummyInstallCmd(dist)
- dist.command_obj['install'] = install
+ dist.command_obj['install_dist'] = install
 
 cmd = install_distinfo(dist)
 dist.command_obj['install_distinfo'] = cmd
@@ -115,7 +115,7 @@
 install_dir = self.mkdtemp()
 
 install = DummyInstallCmd(dist)
- dist.command_obj['install'] = install
+ dist.command_obj['install_dist'] = install
 
 cmd = install_distinfo(dist)
 dist.command_obj['install_distinfo'] = cmd
@@ -136,7 +136,7 @@
 install_dir = self.mkdtemp()
 
 install = DummyInstallCmd(dist)
- dist.command_obj['install'] = install
+ dist.command_obj['install_dist'] = install
 
 fake_dists = os.path.join(os.path.dirname(__file__), '..',
 '_backport', 'tests', 'fake_dists')
diff --git a/distutils2/tests/test_command_install_scripts.py b/distutils2/tests/test_command_install_scripts.py
--- a/distutils2/tests/test_command_install_scripts.py
+++ b/distutils2/tests/test_command_install_scripts.py
@@ -16,7 +16,7 @@
 dist = Distribution()
 dist.command_obj["build"] = support.DummyCommand(
 build_scripts="/foo/bar")
- dist.command_obj["install"] = support.DummyCommand(
+ dist.command_obj["install_dist"] = support.DummyCommand(
 install_scripts="/splat/funk",
 force=1,
 skip_build=1,
@@ -59,7 +59,7 @@
 target = self.mkdtemp()
 dist = Distribution()
 dist.command_obj["build"] = support.DummyCommand(build_scripts=source)
- dist.command_obj["install"] = support.DummyCommand(
+ dist.command_obj["install_dist"] = support.DummyCommand(
 install_scripts=target,
 force=1,
 skip_build=1,
--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /