diff options
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 29 |
1 files changed, 1 insertions, 28 deletions
@@ -154,34 +154,7 @@ def configuration(parent_package='',top_path=None): def setup_package(): - # Perform 2to3 if needed - local_path = os.path.dirname(os.path.abspath(sys.argv[0])) - src_path = local_path - - if sys.version_info[0] == 3: - src_path = os.path.join(local_path, 'build', 'py3k') - sys.path.insert(0, os.path.join(local_path, 'tools')) - import py3tool - print("Converting to Python3 via 2to3...") - py3tool.sync_2to3('numpy', os.path.join(src_path, 'numpy')) - - site_cfg = os.path.join(local_path, 'site.cfg') - if os.path.isfile(site_cfg): - shutil.copy(site_cfg, src_path) - - # Ugly hack to make pip work with Python 3, see #1857. - # Explanation: pip messes with __file__ which interacts badly with the - # change in directory due to the 2to3 conversion. Therefore we restore - # __file__ to what it would have been otherwise. - global __file__ - __file__ = os.path.join(os.curdir, os.path.basename(__file__)) - if '--egg-base' in sys.argv: - # Change pip-egg-info entry to absolute path, so pip can find it - # after changing directory. - idx = sys.argv.index('--egg-base') - if sys.argv[idx + 1] == 'pip-egg-info': - sys.argv[idx + 1] = os.path.join(local_path, 'pip-egg-info') - + src_path = os.path.dirname(os.path.abspath(sys.argv[0])) old_path = os.getcwd() os.chdir(src_path) sys.path.insert(0, src_path) |