summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-21 21:26:44 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-21 23:10:27 -0600
commitb4180e3a3a3a85f0835019d4cb7d10357c78b76c (patch)
tree390dc6656f97db7eb130f0a46e4f75d257dcb638 /setup.py
parentee19043127784e579a45ceb2f02ff350ec8b6019 (diff)
downloadpython-numpy-b4180e3a3a3a85f0835019d4cb7d10357c78b76c.tar.gz
python-numpy-b4180e3a3a3a85f0835019d4cb7d10357c78b76c.tar.bz2
python-numpy-b4180e3a3a3a85f0835019d4cb7d10357c78b76c.zip
2to3: Stop using 2to3 and remove the tools/py3tool.py file.
The same code base now supports python versions 2.6-2.7 and 3.2-3.3. Closes #3247.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py29
1 files changed, 1 insertions, 28 deletions
diff --git a/setup.py b/setup.py
index 457a6e034..6989a7a97 100755
--- a/setup.py
+++ b/setup.py
@@ -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)