import shutil
import sys
-from distutils.core import setup, Command
+from distutils.core import setup, Command, Extension
+
+try:
+ from Pyrex.Distutils import build_ext
+except ImportError:
+ from distutils.command.build_ext import build_ext
+ ext_modules = []
+else:
+ ext_modules = [Extension(
+ 'bulletml._collision', [os.path.join('bulletml', '_collision.pyx')])]
+
from distutils.command.clean import clean as distutils_clean
from distutils.command.sdist import sdist as distutils_sdist
raise SystemExit("Test failures are listed above.")
if __name__ == "__main__":
- setup(cmdclass=dict(
- clean=clean, test=test_cmd, coverage=coverage_cmd, sdist=sdist),
+ setup(cmdclass=dict(clean=clean, test=test_cmd, coverage=coverage_cmd,
+ sdist=sdist, build_ext=build_ext),
name="python-bulletml", version="1",
url="http://code.google.com/p/python-bulletml/",
description="parse and run BulletML scripts",
packages=["bulletml"],
data_files=glob.glob("examples/*/*.xml") + ["examples/template.xml"],
scripts=["bulletml-runner", "bulletml-to-bulletyaml"],
+ ext_modules=ext_modules,
long_description="""\
BulletML is the Bullet Markup Language. BulletML can describe the
barrage of bullets in shooting games. (For example Progear, Psyvariar,