-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
93 lines (79 loc) · 2.95 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 2019 Allen Institute
# This file is part of dipde
# dipde 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.
#
# dipde 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
# along with dipde. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import dipde
import io
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
def prepend_find_packages(*roots):
"""Recursively traverse nested packages under the root directories"""
packages = []
for root in roots:
packages += [root]
packages += [root + '.' + s for s in find_packages(root)]
return packages
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--junitxml=result.xml']
self.test_args_cov = self.test_args + ['--cov=dipde', '--cov-report=term', '--cov-report=html','--cov-config=.coveragerc']
self.test_suite = True
def run_tests(self):
import pytest
try:
errcode = pytest.main(self.test_args_cov)
except:
errcode = pytest.main(self.test_args)
sys.exit(errcode)
setup(
name='dipde',
version=dipde.__version__,
url='https://github.com/AllenBrainAtlas/DiPDE',
author='Nicholas Cain',
tests_require=['pytest'],
install_requires=[],
cmdclass={'test': PyTest},
author_email='[email protected]',
description='Numerical solver for coupled population density equations',
long_description='',
packages=prepend_find_packages('dipde'),
include_package_data=True,
package_data={'':['*.md', '*.txt', '*.cfg']},
platforms='any',
classifiers = [
'Development Status :: 5 - Production/Stable ',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
extras_require={
'testing': ['pytest'],
}
)