Skip to content

Commit 425ecf0

Browse files
committed
Adjusted setup.py to deal more gracefully with build failures of our optional extensions
1 parent 449e80b commit 425ecf0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
from distutils.core import setup, Extension
33
from distutils.command.build_py import build_py
4+
from distutils.command.build_ext import build_ext
45

56
import os, sys
67

@@ -10,9 +11,19 @@
1011
# don't pull it in if we don't have to
1112
if 'setuptools' in sys.modules:
1213
import setuptools.command.build_py as setuptools_build_py_module
14+
from setuptools.command.build_ext import build_ext
1315
except ImportError:
1416
pass
1517

18+
class build_ext_nofail(build_ext):
19+
"""Doesn't fail when build our optional extensions"""
20+
def run(self):
21+
try:
22+
build_ext.run(self)
23+
except Exception:
24+
print "Ignored failure when building extensions, pure python modules will be used instead"
25+
# END ignore errors
26+
1627
def get_data_files(self):
1728
"""Can you feel the pain ? So, in python2.5 and python2.4 coming with maya,
1829
the line dealing with the ``plen`` has a bug which causes it to truncate too much.
@@ -55,7 +66,8 @@ def get_data_files(self):
5566
setuptools_build_py_module.build_py._get_data_files = get_data_files
5667
# END apply setuptools patch too
5768

58-
setup(name = "gitdb",
69+
setup(cmdclass={'build_ext':build_ext_nofail},
70+
name = "gitdb",
5971
version = "0.5.1",
6072
description = "Git Object Database",
6173
author = "Sebastian Thiel",

0 commit comments

Comments
 (0)