diff options
author | Lennart Regebro <regebro@gmail.com> | 2012-08-21 20:52:16 +0200 |
---|---|---|
committer | Lennart Regebro <regebro@gmail.com> | 2012-08-21 20:52:16 +0200 |
commit | 42afe54cf9e15ef655e7ed5fef9483682fcd5af2 (patch) | |
tree | 5b0569f136e71c8b06c42cac0edb9f23235e0ec9 /setuptools/command/develop.py | |
parent | 61f4c9c4cbf148253c9e06f3e05757e01affeb6e (diff) | |
download | external_python_setuptools-42afe54cf9e15ef655e7ed5fef9483682fcd5af2.tar.gz external_python_setuptools-42afe54cf9e15ef655e7ed5fef9483682fcd5af2.tar.bz2 external_python_setuptools-42afe54cf9e15ef655e7ed5fef9483682fcd5af2.zip |
Added fix for the develop command, #299.
--HG--
branch : distribute
extra : rebase_source : ef69472e5a9ce97d9102578898e81e516f06497a
Diffstat (limited to 'setuptools/command/develop.py')
-rwxr-xr-x | setuptools/command/develop.py | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index 93b7773c..c8bef72e 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -84,11 +84,35 @@ class develop(easy_install): " installation directory", p, normalize_path(os.curdir)) def install_for_development(self): - # Ensure metadata is up-to-date - self.run_command('egg_info') - # Build extensions in-place - self.reinitialize_command('build_ext', inplace=1) - self.run_command('build_ext') + if getattr(self.distribution, 'use_2to3', False): + # If we run 2to3 we can not do this inplace: + + # Ensure metadata is up-to-date + self.reinitialize_command('build_py', inplace=0) + self.run_command('build_py') + bpy_cmd = self.get_finalized_command("build_py") + build_path = normalize_path(bpy_cmd.build_lib) + + # Build extensions + self.reinitialize_command('egg_info', egg_base=build_path) + self.run_command('egg_info') + + self.reinitialize_command('build_ext', inplace=0) + self.run_command('build_ext') + + # Fixup egg-link and easy-install.pth + 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 + else: + # Without 2to3 inplace works fine: + self.run_command('egg_info') + + # Build extensions in-place + self.reinitialize_command('build_ext', inplace=1) + self.run_command('build_ext') + self.install_site_py() # ensure that target dir is site-safe if setuptools.bootstrap_install_from: self.easy_install(setuptools.bootstrap_install_from) |