diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2014-06-18 20:31:05 +0300 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2014-06-18 20:31:05 +0300 |
commit | 8e3f9d3253d1d0fb820dad4249d5110d017595c1 (patch) | |
tree | 04cb00f66a8e3a6b41031d7dfb39c598ce4aa06d /setuptools/command/develop.py | |
parent | afea314acbcd6db19dcc96d84fa9652f71b883fb (diff) | |
download | external_python_setuptools-8e3f9d3253d1d0fb820dad4249d5110d017595c1.tar.gz external_python_setuptools-8e3f9d3253d1d0fb820dad4249d5110d017595c1.tar.bz2 external_python_setuptools-8e3f9d3253d1d0fb820dad4249d5110d017595c1.zip |
Fixed PEP 8 compliancy of the setuptools.command package
Diffstat (limited to 'setuptools/command/develop.py')
-rwxr-xr-x | setuptools/command/develop.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 74d12949..368b64fe 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -1,13 +1,14 @@ -import os -import glob from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError +import os +import glob -import setuptools from pkg_resources import Distribution, PathMetadata, normalize_path from setuptools.command.easy_install import easy_install from setuptools.compat import PY3 +import setuptools + class develop(easy_install): """Set up package for development""" @@ -36,7 +37,7 @@ class develop(easy_install): self.egg_path = None easy_install.initialize_options(self) self.setup_path = None - self.always_copy_from = '.' # always copy eggs installed in curdir + self.always_copy_from = '.' # always copy eggs installed in curdir def finalize_options(self): ei = self.get_finalized_command("egg_info") @@ -52,29 +53,31 @@ class develop(easy_install): # pick up setup-dir .egg files only: no .egg-info self.package_index.scan(glob.glob('*.egg')) - self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link') + self.egg_link = os.path.join(self.install_dir, ei.egg_name + + '.egg-link') self.egg_base = ei.egg_base if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) target = normalize_path(self.egg_base) - egg_path = normalize_path(os.path.join(self.install_dir, self.egg_path)) + egg_path = normalize_path(os.path.join(self.install_dir, + self.egg_path)) if egg_path != target: raise DistutilsOptionError( "--egg-path must be a relative path from the install" - " directory to "+target + " directory to " + target ) # Make a distribution for the package's source self.dist = Distribution( target, PathMetadata(target, os.path.abspath(ei.egg_info)), - project_name = ei.egg_name + project_name=ei.egg_name ) - p = self.egg_base.replace(os.sep,'/') - if p!= os.curdir: - p = '../' * (p.count('/')+1) + p = self.egg_base.replace(os.sep, '/') + if p != os.curdir: + p = '../' * (p.count('/') + 1) self.setup_path = p p = normalize_path(os.path.join(self.install_dir, self.egg_path, p)) if p != normalize_path(os.curdir): @@ -103,7 +106,8 @@ class develop(easy_install): ei_cmd = self.get_finalized_command("egg_info") self.egg_path = build_path self.dist.location = build_path - self.dist._provider = PathMetadata(build_path, ei_cmd.egg_info) # XXX + # XXX + self.dist._provider = PathMetadata(build_path, ei_cmd.egg_info) else: # Without 2to3 inplace works fine: self.run_command('egg_info') @@ -120,7 +124,7 @@ class develop(easy_install): # create an .egg-link in the installation dir, pointing to our egg log.info("Creating %s (link to %s)", self.egg_link, self.egg_base) if not self.dry_run: - f = open(self.egg_link,"w") + f = open(self.egg_link, "w") f.write(self.egg_path + "\n" + self.setup_path) f.close() # postprocess the installed distro, fixing up .pth, installing scripts, @@ -133,7 +137,8 @@ class develop(easy_install): egg_link_file = open(self.egg_link) contents = [line.rstrip() for line in egg_link_file] egg_link_file.close() - if contents not in ([self.egg_path], [self.egg_path, self.setup_path]): + if contents not in ([self.egg_path], + [self.egg_path, self.setup_path]): log.warn("Link points to %s: uninstall aborted", contents) return if not self.dry_run: @@ -147,7 +152,7 @@ class develop(easy_install): def install_egg_scripts(self, dist): if dist is not self.dist: # Installing a dependency, so fall back to normal behavior - return easy_install.install_egg_scripts(self,dist) + return easy_install.install_egg_scripts(self, dist) # create wrapper scripts in the script dir, pointing to dist.scripts @@ -158,7 +163,7 @@ class develop(easy_install): for script_name in self.distribution.scripts or []: script_path = os.path.abspath(convert_path(script_name)) script_name = os.path.basename(script_path) - f = open(script_path,'rU') + f = open(script_path, 'rU') script_text = f.read() f.close() self.install_script(dist, script_name, script_text, script_path) |