setup.py.in 1.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

from distutils.core import setup
from distutils.extension import Extension
from distutils.command.build_ext import build_ext
from os import path
from shutil import copy2

with open(path.join('@CMAKE_SOURCE_DIR@', 'README.md'), encoding='utf-8' ) as f:
    long_description = f.read()

liblocs = {@python_libloc@}

# cmake builds the .so files in eris already; all we need to do is move them to the right place
class FakeBuild(build_ext):
    def run(self):
        for ext in self.extensions:
            copy2(liblocs[ext.name], self.get_ext_fullpath(ext.name))

setup(
        name = 'pyeris',
        version = '@PYERIS_VERSION_MAJOR@.@PYERIS_VERSION_MINOR@.@PYERIS_VERSION_PATCH@',
        description = '@pyeris_description@',
        long_description = long_description,
        url = '@pyeris_url@',
        author = '@pyeris_author_name@',
        author_email = '@pyeris_author_email@',
        license = 'GPLv3+',

        classifiers = [
            'Development Status :: 3 - Alpha',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
            'Programming Language :: C++',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 3'
        ],

        keywords = 'eris economics ABM agent-based modelling',
        packages = ['eris'],
        ext_modules=[Extension('eris.'+x, []) for x in '@pyeris_modules@'.split(';')],
        cmdclass = { 'build_ext': FakeBuild },
        package_dir = { '': '@CMAKE_CURRENT_BINARY_DIR@' },

)