Newer
Older
"""Installation script for EarthDiagnostics package"""
from setuptools import setup, Command, find_packages
here = path.abspath(path.dirname(__file__))
# Get the version number from the relevant file
with open(path.join(here, 'VERSION')) as f:
version = f.read().strip()
class RunTests(Command):
"""Class to run tests and generate reports."""
user_options = []
def initialize_options(self):
"""Do nothing."""
def finalize_options(self):
"""Do nothing."""
def run(self):
"""Run tests and generate a coverage report."""
import pytest
version = sys.version_info[0]
report_dir = 'test/report/python{}'.format(version)
'test',
'earthdiagnostics', # for doctests
'--ignore=test/report',
'--doctest-modules',
'--cov-report=term',
'--cov-report=html:{}/coverage_html'.format(report_dir),
'--cov-report=xml:{}/coverage.xml'.format(report_dir),
'--junit-xml={}/report.xml'.format(report_dir),
'--html={}/report.html'.format(report_dir),
]
errno = pytest.main(args)
sys.exit(errno)
setup(
name='earthdiagnostics',
license='GNU GPL v3',
platforms=['GNU/Linux Debian'],
version=version,
description='EarthDiagnostics',
author='BSC-CNS Earth Sciences Department',
author_email='javier.vegas@bsc.es',
url='http://www.bsc.es/projects/earthsciences/autosubmit/',
keywords=['climate', 'weather', 'diagnostic'],
install_requires=['numpy', 'netCDF4', 'bscearth.utils', 'cdo>=1.3.4', 'nco>=0.0.3', 'scitools-iris>=2.2',
'coverage', 'openpyxl', 'mock', 'futures', 'xxhash', 'six', 'psutil', 'cfgrib',
packages=find_packages(),
include_package_data=True,
scripts=['bin/earthdiags'],
cmdclass={
'test': RunTests,
},