Skip to content
Browse files

Make installation with Python 3 possible.

  • Loading branch information...
1 parent 64eab80 commit b9f6e707fbcd50964bce4aa0f2756bb4c7b336ca @takluyver committed Aug 4, 2011
Showing with 22 additions and 3 deletions.
  1. +9 −0 setup3.py
  2. +12 −2 setupbase.py
  3. +1 −1 setupext/__init__.py
View
9 setup3.py
@@ -0,0 +1,9 @@
+import os.path
+from setuptools import setup
+
+from setupbase import (setup_args, find_scripts, find_packages)
+
+setup_args['entry_points'] = find_scripts(True)
+setup_args['packages'] = find_packages()
+
+setup(use_2to3 = True, **setup_args)
View
14 setupbase.py
@@ -23,7 +23,10 @@
import os
import sys
-from ConfigParser import ConfigParser
+try:
+ from configparser import ConfigParser
+except:
+ from ConfigParser import ConfigParser
from distutils.command.build_py import build_py
from glob import glob
@@ -40,6 +43,13 @@
def oscmd(s):
print(">", s)
os.system(s)
+
+try:
+ execfile
+except NameError:
+ def execfile(fname, globs, locs=None):
+ locs = locs or globs
+ exec(compile(open(fname).read(), fname, "exec"), globs, locs)
# A little utility we'll need below, since glob() does NOT allow you to do
# exclusion on multiple endings!
@@ -58,7 +68,7 @@ def file_doesnt_endwith(test,endings):
#---------------------------------------------------------------------------
# release.py contains version, authors, license, url, keywords, etc.
-execfile(pjoin('IPython','core','release.py'))
+execfile(pjoin('IPython','core','release.py'), globals())
# Create a dict with the basic information
# This dict is eventually passed to setup after additional keys are added.
View
2 setupext/__init__.py
@@ -1,3 +1,3 @@
# load extended setup modules for distuils
-from install_data_ext import install_data_ext
+from .install_data_ext import install_data_ext

0 comments on commit b9f6e70

Please sign in to comment.
Something went wrong with that request. Please try again.