From b054af5817aed2be88ed6ba856a86423e18edc09 Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 6 Sep 2017 15:21:36 -0500 Subject: dist_info: implement command --- setuptools/command/dist_info.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 setuptools/command/dist_info.py (limited to 'setuptools/command') diff --git a/setuptools/command/dist_info.py b/setuptools/command/dist_info.py new file mode 100644 index 00000000..c8dc659b --- /dev/null +++ b/setuptools/command/dist_info.py @@ -0,0 +1,37 @@ +""" +Create a dist_info directory +As defined in the wheel specification +""" + +import os +import shutil + +from distutils.core import Command + + +class dist_info(Command): + + description = 'create a .dist-info directory' + + user_options = [ + ('egg-base=', 'e', "directory containing .egg-info directories" + " (default: top of the source tree)"), + ] + + def initialize_options(self): + self.egg_base = None + + def finalize_options(self): + pass + + def run(self): + egg_info = self.get_finalized_command('egg_info') + egg_info.run() + dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info' + + bdist_wheel = self.get_finalized_command('bdist_wheel') + bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir) + + if self.egg_base: + shutil.move(dist_info_dir, os.path.join( + self.egg_base, dist_info_dir)) -- cgit v1.2.3 From 944976d869b96d6a960daf45bf8545987c6dea91 Mon Sep 17 00:00:00 2001 From: xoviat Date: Thu, 7 Sep 2017 22:15:03 -0500 Subject: dist_info: register command --- setuptools/command/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py index c96d33c2..4fe3bb56 100644 --- a/setuptools/command/__init__.py +++ b/setuptools/command/__init__.py @@ -2,7 +2,7 @@ __all__ = [ 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', - 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', + 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', 'dist_info', ] from distutils.command.bdist import bdist -- cgit v1.2.3 From 60270c2422caa7ed2b33a327c63a85395f7c23a8 Mon Sep 17 00:00:00 2001 From: xoviat Date: Fri, 13 Oct 2017 16:02:38 -0500 Subject: commands: dist_info: say something! The dist_info command did not say anything like other commands did. This gives some more helpful information. --- setuptools/command/dist_info.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setuptools/command') diff --git a/setuptools/command/dist_info.py b/setuptools/command/dist_info.py index c8dc659b..c6c6dacb 100644 --- a/setuptools/command/dist_info.py +++ b/setuptools/command/dist_info.py @@ -7,6 +7,7 @@ import os import shutil from distutils.core import Command +from distutils import log class dist_info(Command): @@ -28,10 +29,12 @@ class dist_info(Command): egg_info = self.get_finalized_command('egg_info') egg_info.run() dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info' + log.info("creating '{}'".format(os.path.abspath(dist_info_dir))) bdist_wheel = self.get_finalized_command('bdist_wheel') bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir) if self.egg_base: - shutil.move(dist_info_dir, os.path.join( - self.egg_base, dist_info_dir)) + destination = os.path.join(self.egg_base, dist_info_dir) + log.info("creating '{}'".format(os.path.abspath(destination))) + shutil.move(dist_info_dir, destination) -- cgit v1.2.3 From cb0d6a91d8df8b4c70b95432ad33364181e49c33 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 25 Oct 2017 10:09:37 -0400 Subject: Feed the hobgoblins (delint). --- setuptools/command/develop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 85b23c60..959c932a 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -95,7 +95,9 @@ class develop(namespaces.DevelopInstaller, easy_install): path_to_setup = egg_base.replace(os.sep, '/').rstrip('/') if path_to_setup != os.curdir: path_to_setup = '../' * (path_to_setup.count('/') + 1) - resolved = normalize_path(os.path.join(install_dir, egg_path, path_to_setup)) + resolved = normalize_path( + os.path.join(install_dir, egg_path, path_to_setup) + ) if resolved != normalize_path(os.curdir): raise DistutilsOptionError( "Can't get a consistent path to setup script from" -- cgit v1.2.3 From 9da60d4ae2727a61eb11bd7c6393567e0793d128 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 25 Oct 2017 10:14:40 -0400 Subject: Shorten link for nicer indentation --- setuptools/command/easy_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 8fba7b41..71991efa 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1817,7 +1817,7 @@ def _update_zipimporter_cache(normalized_path, cache, updater=None): # get/del patterns instead. For more detailed information see the # following links: # https://github.com/pypa/setuptools/issues/202#issuecomment-202913420 - # https://bitbucket.org/pypy/pypy/src/dd07756a34a41f674c0cacfbc8ae1d4cc9ea2ae4/pypy/module/zipimport/interp_zipimport.py#cl-99 + # http://bit.ly/2h9itJX old_entry = cache[p] del cache[p] new_entry = updater and updater(p, old_entry) -- cgit v1.2.3 From ada14dc9f376d9c325ad2eac8a20122b8da2c15e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 25 Oct 2017 10:23:14 -0400 Subject: Feed the hobgoblins (delint). --- setuptools/command/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py index 4fe3bb56..fe619e2e 100644 --- a/setuptools/command/__init__.py +++ b/setuptools/command/__init__.py @@ -2,7 +2,8 @@ __all__ = [ 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', - 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', 'dist_info', + 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', + 'dist_info', ] from distutils.command.bdist import bdist -- cgit v1.2.3