Mercurial > genshi > genshi-test
comparison setup.py @ 673:3a949bcaaf3d
Ignore missing compiler errors on Windows. Fixes #174 and #165.
author | athomas |
---|---|
date | Thu, 10 Jan 2008 00:56:05 +0000 |
parents | e4ec94fcb0c0 |
children | 09a90feb9269 |
comparison
equal
deleted
inserted
replaced
672:e69d95e80231 | 673:3a949bcaaf3d |
---|---|
12 # individuals. For the exact contribution history, see the revision | 12 # individuals. For the exact contribution history, see the revision |
13 # history and logs, available at http://genshi.edgewall.org/log/. | 13 # history and logs, available at http://genshi.edgewall.org/log/. |
14 | 14 |
15 from distutils.cmd import Command | 15 from distutils.cmd import Command |
16 from distutils.command.build_ext import build_ext | 16 from distutils.command.build_ext import build_ext |
17 from distutils.errors import CCompilerError | 17 from distutils.errors import CCompilerError, DistutilsPlatformError |
18 import doctest | 18 import doctest |
19 from glob import glob | 19 from glob import glob |
20 import os | 20 import os |
21 try: | 21 try: |
22 from setuptools import setup, Extension, Feature | 22 from setuptools import setup, Extension, Feature |
32 build_doc = test_doc = None | 32 build_doc = test_doc = None |
33 | 33 |
34 | 34 |
35 class optional_build_ext(build_ext): | 35 class optional_build_ext(build_ext): |
36 # This class allows C extension building to fail. | 36 # This class allows C extension building to fail. |
37 def run(self): | |
38 try: | |
39 build_ext.run(self) | |
40 except DistutilsPlatformError: | |
41 self._unavailable() | |
42 | |
37 def build_extension(self, ext): | 43 def build_extension(self, ext): |
38 try: | 44 try: |
39 build_ext.build_extension(self, ext) | 45 build_ext.build_extension(self, ext) |
40 except CCompilerError, x: | 46 except CCompilerError, x: |
41 print '*' * 70 | 47 self._unavailable() |
42 print """WARNING: | 48 |
49 def _unavailable(self): | |
50 print '*' * 70 | |
51 print """WARNING: | |
43 An optional C extension could not be compiled, speedups will not be | 52 An optional C extension could not be compiled, speedups will not be |
44 available.""" | 53 available.""" |
45 print '*' * 70 | 54 print '*' * 70 |
46 | 55 |
47 | 56 |
48 if Feature: | 57 if Feature: |
49 speedups = Feature( | 58 speedups = Feature( |
50 "optionial C speed-enhancements", | 59 "optionial C speed-enhancements", |