|
|
"""Distutils setup file""" |
"""Distutils setup file""" |
|
|
|
include_tests = True # edit this to stop installation of test modules |
|
include_metamodels = True # edit this to stop installation of MOF, UML, etc. |
|
|
|
|
|
# Base packages for installation |
|
|
|
packages = [ |
|
'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model', |
|
'peak.naming', 'peak.naming.factories', 'peak.running', |
|
'peak.storage', 'peak.util', |
|
|
|
'Interface', 'Interface.Common', 'Interface.Registry', |
|
'Persistence', |
|
] |
|
|
|
|
|
# Base data files |
|
|
|
data_files = [ |
|
('peak', ['src/peak/peak.ini']), |
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if include_tests: |
|
|
|
packages += [ |
|
'peak.tests', 'peak.binding.tests', 'peak.config.tests', |
|
'peak.model.tests', 'peak.naming.tests', 'peak.running.tests', |
|
'peak.storage.tests', 'peak.util.tests', |
|
|
|
'Interface.tests', 'Interface.Common.tests', |
|
'Interface.Registry.tests', |
|
] |
|
|
|
data_files += [ |
|
('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']), |
|
] |
|
|
|
|
|
if include_metamodels: |
|
|
|
packages += [ |
|
'peak.metamodels', |
|
'peak.metamodels.UML13', |
|
'peak.metamodels.UML13.Foundation', |
|
'peak.metamodels.UML13.model', |
|
'peak.metamodels.UML13.model.Foundation', |
|
'peak.metamodels.UML13.model.Behavioral_Elements', |
|
] |
|
|
|
if include_tests: |
|
|
|
packages += [ |
|
'peak.metamodels.tests', |
|
] |
|
|
|
data_files += [ |
|
('peak/metamodels/tests', |
|
['src/peak/metamodels/tests/MetaMeta.xml'] |
|
), |
|
] |
|
|
|
|
|
|
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""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class test(Command): |
class test(Command): |
|
|
"""Command to run unit tests after installation""" |
"""Command to run unit tests after installation""" |
self.happy_options = [ |
self.happy_options = [ |
'-t', 'PEAK Reference', '-d', self.doc_output_path, |
'-t', 'PEAK Reference', '-d', self.doc_output_path, |
'-i', 'examples', '-i', 'old', '-i', 'tests', |
'-i', 'examples', '-i', 'old', '-i', 'tests', |
'-i', 'metamodels', '-i', 'Interface', '-i', 'Persistence', |
'-i', 'Interface', '-i', 'Persistence', |
'-i', 'kjbuckets', '.' |
'-i', 'kjbuckets', '.' |
] |
] |
if not self.verbose: self.happy_options.insert(0,'-q') |
if not self.verbose: self.happy_options.insert(0,'-q') |
license="PSF or ZPL", |
license="PSF or ZPL", |
platforms=['UNIX','Windows'], |
platforms=['UNIX','Windows'], |
|
|
packages=[ |
packages = packages, |
'peak', 'peak.api', 'peak.binding', 'peak.model', 'peak.metamodels', |
|
'peak.metamodels.mof', 'peak.metamodels.uml', |
|
'peak.naming', 'peak.naming.factories', 'peak.util', 'peak.running', |
|
'peak.config', 'peak.storage', |
|
|
|
'peak.binding.tests', 'peak.config.tests', 'peak.storage.tests', |
|
'peak.metamodels.tests', 'peak.util.tests', 'peak.naming.tests', |
|
'peak.model.tests', 'peak.tests', 'peak.running.tests', |
|
|
|
'Interface', 'Interface.tests', |
|
'Interface.Common', 'Interface.Common.tests', |
|
'Interface.Registry', 'Interface.Registry.tests', |
|
'Persistence', |
|
], |
|
|
|
package_dir = {'':'src'}, |
package_dir = {'':'src'}, |
|
|
|
cmdclass = { |
|
'install_data': install_data, 'sdist': sdist, 'happy': happy, |
|
'test': test, 'sdist_nodoc': old_sdist, 'build_ext': build_ext, |
|
}, |
|
|
|
data_files = data_files, |
|
|
ext_modules = [ |
ext_modules = [ |
Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]), |
Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]), |
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.binding._once", [ |
|
"src/peak/binding/_once" + EXT, |
|
"src/peak/binding/getdict.c" |
cmdclass = { |
] |
'install_data': install_data, 'sdist': sdist, 'happy': happy, |
), |
'test': test, 'sdist_nodoc': old_sdist, |
Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]), |
}, |
Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]), |
|
|
data_files = [ |
|
('peak', ['src/peak/peak.ini']), |
|
('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']), |
|
('peak/metamodels/tests', ['src/peak/metamodels/tests/MetaMeta.xml']), |
|
], |
], |
|
|
) |
) |