summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-08 11:24:20 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-08 11:46:17 +0200
commitf534e6e9a24f2ac7e7e0f3679551b512d4af569a (patch)
tree17ad3e650843715ccb8050bc878c836240a13adc
parentac7d4757ab4041f5f0f5806934130024b098bb82 (diff)
downloadgitdb-0.5.0.tar.gz
Added fixes to setup.py to allow easy_installation0.5.0
m---------ext/async0
-rwxr-xr-xsetup.py57
2 files changed, 56 insertions, 1 deletions
diff --git a/ext/async b/ext/async
-Subproject 76f15fc4b3e3ccb0160d6c887181f29095d16f2
+Subproject 0819784229dc98f92d2c57d740c9aebd533846d
diff --git a/setup.py b/setup.py
index b6c2c41..1afeb3e 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,60 @@
#!/usr/bin/env python
from distutils.core import setup, Extension
-
+from distutils.command.build_py import build_py
+
+import os, sys
+
+# wow, this is a mixed bag ... I am pretty upset about all of this ...
+setuptools_build_py_module = None
+try:
+ # don't pull it in if we don't have to
+ if 'setuptools' in sys.modules:
+ import setuptools.command.build_py as setuptools_build_py_module
+except ImportError:
+ pass
+
+def get_data_files(self):
+ """Can you feel the pain ? So, in python2.5 and python2.4 coming with maya,
+ the line dealing with the ``plen`` has a bug which causes it to truncate too much.
+ It is fixed in the system interpreters as they receive patches, and shows how
+ bad it is if something doesn't have proper unittests.
+ The code here is a plain copy of the python2.6 version which works for all.
+
+ Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
+ data = []
+ if not self.packages:
+ return data
+
+ # this one is just for the setup tools ! They don't iniitlialize this variable
+ # when they should, but do it on demand using this method.Its crazy
+ if hasattr(self, 'analyze_manifest'):
+ self.analyze_manifest()
+ # END handle setuptools ...
+
+ for package in self.packages:
+ # Locate package source directory
+ src_dir = self.get_package_dir(package)
+
+ # Compute package build directory
+ build_dir = os.path.join(*([self.build_lib] + package.split('.')))
+
+ # Length of path to strip from found files
+ plen = 0
+ if src_dir:
+ plen = len(src_dir)+1
+
+ # Strip directory from globbed filenames
+ filenames = [
+ file[plen:] for file in self.find_data_files(package, src_dir)
+ ]
+ data.append((package, src_dir, build_dir, filenames))
+ return data
+
+build_py.get_data_files = get_data_files
+if setuptools_build_py_module:
+ setuptools_build_py_module.build_py._get_data_files = get_data_files
+# END apply setuptools patch too
+
setup(name = "gitdb",
version = "0.5.0",
description = "Git Object Database",
@@ -14,5 +68,6 @@ setup(name = "gitdb",
ext_modules=[Extension('gitdb._fun', ['_fun.c'])],
license = "BSD License",
requires=('async (>=0.6.0)',),
+ install_requires='async >= 0.6.0',
long_description = """GitDB is a pure-Python git object database"""
)