diff options
author | ?ric Araujo <merwok@netwok.org> | 2011-11-12 05:51:01 +0100 |
---|---|---|
committer | ?ric Araujo <merwok@netwok.org> | 2011-11-12 05:51:01 +0100 |
commit | e65890db19e3b798752544632abd303625c4a7f7 (patch) | |
tree | 67963e490ea9b7395b70e1b66162017c3b32bc1b | |
parent | 586eaba21873e8c789e5e69372e0286f6614c8b5 (diff) | |
download | disutils2-e65890db19e3b798752544632abd303625c4a7f7.tar.gz |
Use more usual name for one option of install_distinfo
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | distutils2/command/install_dist.py | 4 | ||||
-rw-r--r-- | distutils2/command/install_distinfo.py | 25 | ||||
-rw-r--r-- | distutils2/tests/test_command_install_distinfo.py | 10 |
4 files changed, 20 insertions, 21 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 76c3b39..d29edc3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -155,6 +155,8 @@ CONTRIBUTORS.txt for full names. Bug numbers refer to http://bugs.python.org/. - The signature of tests.support.LoggingCatcher.get_logs changed, see docstring [éric] - Rename get_reinitialized_command back to reinitialize_command [éric] +- Rename install_distinfo's option from distinfo-dir to the more usual + install_dir [éric] 1.0a3 - 2010-10-08 diff --git a/distutils2/command/install_dist.py b/distutils2/command/install_dist.py index 884699b..56e35ee 100644 --- a/distutils2/command/install_dist.py +++ b/distutils2/command/install_dist.py @@ -58,9 +58,7 @@ class install_dist(Command): ('install-data=', None, "installation directory for data files"), - # Byte-compilation options -- see install_lib.py for details, as - # these are duplicated from there (but only install_lib does - # anything with them). + # Byte-compilation options -- see install_lib for details ('compile', 'c', "compile .py to .pyc [default]"), ('no-compile', None, "don't compile .py files"), ('optimize=', 'O', diff --git a/distutils2/command/install_distinfo.py b/distutils2/command/install_distinfo.py index fcbd774..9527bd5 100644 --- a/distutils2/command/install_distinfo.py +++ b/distutils2/command/install_distinfo.py @@ -20,8 +20,8 @@ class install_distinfo(Command): description = 'create a .dist-info directory for the distribution' user_options = [ - ('distinfo-dir=', None, - "directory where the the .dist-info directory will be installed"), + ('install-dir=', None, + "directory where the the .dist-info directory will be created"), ('installer=', None, "the name of the installer"), ('requested', None, @@ -39,7 +39,7 @@ class install_distinfo(Command): negative_opt = {'no-requested': 'requested'} def initialize_options(self): - self.distinfo_dir = None + self.install_dir = None self.installer = None self.requested = None self.no_record = None @@ -50,8 +50,7 @@ class install_distinfo(Command): self.set_undefined_options('install_dist', 'installer', 'requested', 'no_record') - self.set_undefined_options('install_lib', - ('install_dir', 'distinfo_dir')) + self.set_undefined_options('install_lib', 'install_dir') if self.installer is None: # FIXME distutils or packaging or distutils2? @@ -68,26 +67,26 @@ class install_distinfo(Command): basename = metadata.get_fullname(filesafe=True) + ".dist-info" - self.distinfo_dir = os.path.join(self.distinfo_dir, basename) + self.install_dir = os.path.join(self.install_dir, basename) def run(self): - target = self.distinfo_dir + target = self.install_dir if os.path.isdir(target) and not os.path.islink(target): if not self.dry_run: rmtree(target) elif os.path.exists(target): - self.execute(os.unlink, (self.distinfo_dir,), + self.execute(os.unlink, (self.install_dir,), "removing " + target) self.execute(os.makedirs, (target,), "creating " + target) - metadata_path = os.path.join(self.distinfo_dir, 'METADATA') + metadata_path = os.path.join(self.install_dir, 'METADATA') self.execute(self.distribution.metadata.write, (metadata_path,), "creating " + metadata_path) self.outfiles.append(metadata_path) - installer_path = os.path.join(self.distinfo_dir, 'INSTALLER') + installer_path = os.path.join(self.install_dir, 'INSTALLER') logger.info('creating %s', installer_path) if not self.dry_run: f = open(installer_path, 'w') @@ -98,7 +97,7 @@ class install_distinfo(Command): self.outfiles.append(installer_path) if self.requested: - requested_path = os.path.join(self.distinfo_dir, 'REQUESTED') + requested_path = os.path.join(self.install_dir, 'REQUESTED') logger.info('creating %s', requested_path) if not self.dry_run: open(requested_path, 'wb').close() @@ -107,7 +106,7 @@ class install_distinfo(Command): if not self.no_resources: install_data = self.get_finalized_command('install_data') if install_data.get_resources_out() != []: - resources_path = os.path.join(self.distinfo_dir, + resources_path = os.path.join(self.install_dir, 'RESOURCES') logger.info('creating %s', resources_path) if not self.dry_run: @@ -124,7 +123,7 @@ class install_distinfo(Command): self.outfiles.append(resources_path) if not self.no_record: - record_path = os.path.join(self.distinfo_dir, 'RECORD') + record_path = os.path.join(self.install_dir, 'RECORD') logger.info('creating %s', record_path) if not self.dry_run: f = codecs.open(record_path, 'w', encoding='utf-8') diff --git a/distutils2/tests/test_command_install_distinfo.py b/distutils2/tests/test_command_install_distinfo.py index 338690f..b298c21 100644 --- a/distutils2/tests/test_command_install_distinfo.py +++ b/distutils2/tests/test_command_install_distinfo.py @@ -53,7 +53,7 @@ class InstallDistinfoTestCase(support.TempdirManager, cmd = install_distinfo(dist) dist.command_obj['install_distinfo'] = cmd - cmd.distinfo_dir = install_dir + cmd.install_dir = install_dir cmd.ensure_finalized() cmd.run() @@ -88,7 +88,7 @@ class InstallDistinfoTestCase(support.TempdirManager, cmd = install_distinfo(dist) dist.command_obj['install_distinfo'] = cmd - cmd.distinfo_dir = install_dir + cmd.install_dir = install_dir cmd.installer = 'bacon-python' cmd.ensure_finalized() cmd.run() @@ -111,7 +111,7 @@ class InstallDistinfoTestCase(support.TempdirManager, cmd = install_distinfo(dist) dist.command_obj['install_distinfo'] = cmd - cmd.distinfo_dir = install_dir + cmd.install_dir = install_dir cmd.requested = False cmd.ensure_finalized() cmd.run() @@ -131,7 +131,7 @@ class InstallDistinfoTestCase(support.TempdirManager, cmd = install_distinfo(dist) dist.command_obj['install_distinfo'] = cmd - cmd.distinfo_dir = install_dir + cmd.install_dir = install_dir cmd.no_record = True cmd.ensure_finalized() cmd.run() @@ -235,7 +235,7 @@ class InstallDistinfoTestCase(support.TempdirManager, cmd = install_distinfo(dist) dist.command_obj['install_distinfo'] = cmd - cmd.distinfo_dir = install_dir + cmd.install_dir = install_dir cmd.ensure_finalized() cmd.run() |