Skip to content
Snippets Groups Projects
setup.py 3.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
    #!/usr/bin/env python
    
    """ setup.py for Insect Navigation Toolbox
    (called navipy)
    
    Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
    """
    
    from setuptools import setup, find_packages
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    import glob
    import os
    
    Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
    
    excluded = []
    
    
    def exclude_package(pkg):
        for exclude in excluded:
            if pkg.startswith(exclude):
                return True
        return False
    
    
    def create_package_list(base_package):
        return ([base_package] +
                [base_package + '.' + pkg
                 for pkg
                 in find_packages(base_package)
                 if not exclude_package(pkg)])
    
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    def package_data_files(base_package):
        os.chdir(base_package)
        filelist = glob.glob(os.path.join('resources',
                                          '*'))
        filelist.extend(glob.glob(os.path.join('resources',
                                               '**', '*'),
                                  recursive=True))
        os.chdir('../')
        print(filelist)
        return filelist
    
    
    
    Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
    setup_dict = {'name': 'navipy',
    
                  'version': '0.1.2',
    
    Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
                  'author': "Olivier J.N. Bertrand",
                  'author_email': 'olivier.bertrand@uni-bielefeld.de',
                  'description': 'Insect Navigation Toolbox',
                  'packages': create_package_list("navipy"),
    
                  'url': "https://gitlab.ub.uni-bielefeld.de/olivier.bertrand/navipy.git",
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                  'download_url': 'https://gitlab.ub.uni-bielefeld.de/olivier.bertrand/navipy/-/archive/v_012a/navipy-v_012a.tar.gz',
    
                  'requires': ['numpy',
                               'pandas',
                               'matplotlib',
                               'scipy',
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                               'networkx',
    
                               'yaml',
    
                  'install_requires': ["numpy",
                                       'pandas',
                                       'matplotlib',
                                       'scipy',
                                       'sphinx_rtd_theme',
                                       'networkx',
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                                       'sphinx-argparse',
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                                       'ipython',
                                       'flake8',
    
                                       'pyyaml',
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                                       'tables',
    
                                       'nbsphinx',
    
                                       'coverage',
    
                  'package_data': {'navipy':
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
                                   package_data_files("navipy")},
    
                  'include_package_data': True,
    
                  'entry_points': {
                      'console_scripts': [
    
                          'blendnavipy=navipy.scripts.blendnavipy:main',
                          'blendunittest=navipy.scripts.blendunittest:main',
                          'blendongrid=navipy.scripts.blend_ongrid:main',
                          'blendoverlaytraj=navipy.scripts.blend_overlaytraj:main',
    
                          'blendalongtraj=navipy.scripts.blend_alongtraj:main',
                          'dltcalibrator=navipy.scripts.dlt_calibrator:main'
    
    Olivier J.N. Bertrand's avatar
    Olivier J.N. Bertrand committed
    
    setup(**setup_dict)