summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-02-13 01:42:52 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-02-13 01:42:52 +0000
commit7dcfccb3b0378e1c882828e9baff93b591b6d56a (patch)
treee9c42255f8a3a299938d72937477508036ade864 /setup.py
parenta2a3b701c71b8c424c4e63ee455aed12db2c54e2 (diff)
downloadsqlalchemy-7dcfccb3b0378e1c882828e9baff93b591b6d56a.tar.gz
- Improved the installation/test setup regarding Python 3,
now that Distribute runs on Py3k. distribute_setup.py is now included. See README.py3k for Python 3 installation/ testing instructions.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 392e702cc..3a1b5f1dd 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,19 @@
import os
import sys
import re
+
+extra = {}
+if sys.version_info >= (3, 0):
+ # monkeypatch our preprocessor
+ # onto the 2to3 tool.
+ from sa2to3 import refactor_string
+ from lib2to3.refactor import RefactoringTool
+ RefactoringTool.refactor_string = refactor_string
+
+ extra.update(
+ use_2to3=True,
+ )
+
try:
from setuptools import setup
except ImportError:
@@ -14,7 +27,6 @@ def find_packages(dir_):
packages.append(fragment.replace(os.sep, '.'))
return packages
-
if sys.version_info < (2, 4):
raise Exception("SQLAlchemy requires Python 2.4 or higher.")
@@ -22,6 +34,7 @@ v = open(os.path.join(os.path.dirname(__file__), 'lib', 'sqlalchemy', '__init__.
VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1)
v.close()
+
setup(name = "SQLAlchemy",
version = VERSION,
description = "Database Abstraction Library",
@@ -77,5 +90,6 @@ SVN version:
"Programming Language :: Python :: 3",
"Topic :: Database :: Front-Ends",
"Operating System :: OS Independent",
- ]
+ ],
+ **extra
)