Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit e527a5d

Browse files
committed
Adjusted setup.py to deal more gracefully with build failures of our optional extensions
1 parent 2842d1e commit e527a5d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

setup.py

+13-1
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.
@@ -56,7 +67,8 @@ def get_data_files(self):
5667
# END apply setuptools patch too
5768

5869

59-
setup(name = "async",
70+
setup(cmdclass={'build_ext':build_ext_nofail},
71+
name = "async",
6072
version = "0.6.1",
6173
description = "Async Framework",
6274
author = "Sebastian Thiel",

0 commit comments

Comments
 (0)