Skip to content
Snippets Groups Projects
setup.py 1.94 KiB
Newer Older
'''
Maximilian Schanner's avatar
Maximilian Schanner committed
    This is the install file for pymagglobal.
    Copyright (C) 2020 Helmholtz Centre Potsdam GFZ,
        German Research Centre for Geosciences, Potsdam, Germany

    Cite as:
    TODO

Maximilian Schanner's avatar
Maximilian Schanner committed
    This file is part of pymagglobal.
Maximilian Schanner's avatar
Maximilian Schanner committed
    pymagglobal is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

Maximilian Schanner's avatar
Maximilian Schanner committed
    pymagglobal is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
Maximilian Schanner's avatar
Maximilian Schanner committed
    along with pymagglobal. If not, see <https://www.gnu.org/licenses/>.
'''

import os
import codecs
from setuptools import setup


# https://packaging.python.org/guides/single-sourcing-package-version/
def read(rel_path):
    here = os.path.abspath(os.path.dirname(__file__))
    with codecs.open(os.path.join(here, rel_path), 'r') as fp:
        return fp.read()


def get_version(rel_path):
    for line in read(rel_path).splitlines():
        if line.startswith('__version__'):
            delim = '"' if '"' in line else "'"
            return line.split(delim)[1]
    else:
        raise RuntimeError("Unable to find version string.")

Maximilian Schanner's avatar
Maximilian Schanner committed

description = ''' python interface for global geomagnetic field models '''

setup(
    name='pymagglobal',
    version=get_version('pymagglobal/__init__.py'),
    author='Maximilian Schanner',
    author_email='arthus@gfz-potsdam.de',
    packages=['pymagglobal'],
    license='GPL v3',
    description=description,
    long_description=description,
    install_requires=[],
    package_data={'pymagglobal': ['dat/*']},
    include_package_data=True,
    entry_points={'console_scripts': ['pymagglobal = pymagglobal.__main__:main']}