setup.py 1.66 KB
Newer Older
Yannick Roehlly's avatar
Yannick Roehlly committed
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2012, 2015 Centre de données Astrophysiques de Marseille
3
# Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt
Yannick Roehlly's avatar
Yannick Roehlly committed
4
# Author: Yannick Roehlly
Yannick Roehlly's avatar
Yannick Roehlly committed
5 6 7

from distutils.command.build import build

8 9
from setuptools import find_packages, setup

Yannick Roehlly's avatar
Yannick Roehlly committed
10 11

class custom_build(build):
12 13 14 15 16 17 18 19 20 21 22 23 24
    user_options = [
        ('bc03res=', None, 'Resolution of the BC03 models, hr or lr.'),
        ]
    description = 'Build the pcigale database.'

    def initialize_options(self):
        build.initialize_options(self)
        self.bc03res = 'lr'

    def finalize_options(self):
        assert self.bc03res in ('lr', 'hr'), 'bc03res must be hr or lr!'
        build.finalize_options(self)

Yannick Roehlly's avatar
Yannick Roehlly committed
25 26 27
    def run(self):
        # Build the database.
        import database_builder
28
        database_builder.build_base(self.bc03res)
Yannick Roehlly's avatar
Yannick Roehlly committed
29 30 31 32

        # Proceed with the build
        build.run(self)

33
entry_points = {
34
    'console_scripts': ['pcigale = pcigale:main',
35
                        'pcigale-plots = pcigale_plots:main',
36
                        'pcigale-filters = pcigale_filters:main']
37 38
}

Yannick Roehlly's avatar
Yannick Roehlly committed
39
setup(
40
    name="pcigale",
41
    version="0.12.1",
42
    packages=find_packages(exclude=["database_builder"]),
Yannick Roehlly's avatar
Yannick Roehlly committed
43

44
    install_requires=['numpy', 'scipy', 'sqlalchemy', 'matplotlib',
45
                      'configobj', 'astropy'],
46 47

    entry_points=entry_points,
Yannick Roehlly's avatar
Yannick Roehlly committed
48 49

    cmdclass={"build": custom_build},
50
    package_data={'pcigale': ['data/data.db'],
51
                  'pcigale_plots': ['data/CIGALE.png']},
52

53 54
    author="The CIGALE team",
    author_email="cigale@lam.fr",
55 56 57
    description="Python Code Investigating Galaxy Emission",
    license="CeCILL-V2",
    keywords="astrophysics, galaxy, SED fitting"
Yannick Roehlly's avatar
Yannick Roehlly committed
58
)