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)
REQUIREMENTS = {
'setup': [
'pyproj',
'bscearth.utils',
'cdo>=1.3.4',
'cfgrib',
'dask[array]',
'exrex',
'netCDF4',
'nco>=0.0.3',
'numba',
'numpy',
'psutil',
'openpyxl',
'scitools-iris>=2.2',
'six',
'xxhash',
],
'test': [
'coverage',
'mock',
'pycodestyle',
'pytest',
'pytest-cov',
'pytest-html',
]
}
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=REQUIREMENTS['install'],
test_requires=REQUIREMENTS['test'],
extras_require={
'develop': REQUIREMENTS['test'],
},
packages=find_packages(),
include_package_data=True,