summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorEvax Software <contact@evax.fr>2012-10-04 13:34:39 -0400
committerfarcepest <farcepest@gmail.com>2012-10-04 13:34:39 -0400
commit7a846cf5e35ebcad852309aebaa0bac8a7244744 (patch)
tree4fbd759ae4894cabcd590e15e61b535766a13ee2 /setup.py
parent0164ffeb2534f050148348e50a51641491b6a65d (diff)
downloadmysqldb1-7a846cf5e35ebcad852309aebaa0bac8a7244744.tar.gz
Allow pip install from git
Merged with modifications from https://github.com/evax/MySQLdb1/commit/a8152690101733904b16a32ff8467220ca07242c
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..798f96f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+from distribute_setup import use_setuptools
+use_setuptools()
+from setuptools import setup, Extension
+
+if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000:
+ raise Error("Python 2.4 or newer is required")
+
+if os.name == "posix":
+ from setup_posix import get_config
+else: # assume windows
+ from setup_windows import get_config
+
+metadata, options = get_config()
+metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)]
+metadata['long_description'] = metadata['long_description'].replace(r'\n', '')
+setup(**metadata)