from distutils.core import setup, Command, Extension |
from distutils.core import setup, Command, Extension |
from distutils.command.install_data import install_data |
from distutils.command.install_data import install_data |
from distutils.command.sdist import sdist as old_sdist |
from distutils.command.sdist import sdist as old_sdist |
|
from distutils.command.build_ext import build_ext as old_build_ext |
import sys |
import sys |
|
|
|
try: |
|
from Pyrex.Distutils.build_ext import build_ext |
|
EXT = '.pyx' |
|
except ImportError: |
|
build_ext = old_build_ext |
|
EXT = '.c' |
|
|
|
|
class install_data(install_data): |
class install_data(install_data): |
|
|
"""Variant of 'install_data' that installs data to module directories""" |
"""Variant of 'install_data' that installs data to module directories""" |
# Run the standard sdist command |
# Run the standard sdist command |
old_sdist.run(self) |
old_sdist.run(self) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class test(Command): |
class test(Command): |
|
|
"""Command to run unit tests after installation""" |
"""Command to run unit tests after installation""" |
Extension("Persistence.cPersistence", |
Extension("Persistence.cPersistence", |
["src/Persistence/cPersistence.c"] |
["src/Persistence/cPersistence.c"] |
), |
), |
Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap.c"]), |
Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]), |
|
Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]), |
], |
], |
|
|
|
|
cmdclass = { |
cmdclass = { |
'install_data': install_data, 'sdist': sdist, 'happy': happy, |
'install_data': install_data, 'sdist': sdist, 'happy': happy, |
'test': test, 'sdist_nodoc': old_sdist, |
'test': test, 'sdist_nodoc': old_sdist, 'build_ext': build_ext, |
}, |
}, |
|
|
data_files = [ |
data_files = [ |