-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
124 lines (90 loc) · 3.29 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python
"""
Galton
------
Univariate Voxel Analysis and Correlations Tools
"""
from __future__ import print_function
import os.path as op
import io
import sys
from setuptools import Command, setup, find_packages
from setuptools.command.test import test as TestCommand
from pip.req import parse_requirements
from install_deps import get_requirements
#long description
def read(*filenames, encoding='utf-8', sep='\n'):
buf = []
for filename in filenames:
with io.open(filename, encoding=encoding) as f:
buf.append(f.read())
return sep.join(buf)
# Get version without importing, which avoids dependency issues
module_name = find_packages(exclude=['tests'])[0]
version_pyfile = op.join(module_name, 'version.py')
exec(compile(read(version_pyfile), version_pyfile, 'exec'))
script_path = 'scripts'
#install_reqs = parse_requirements('requirements.txt')
req_files = ['requirements.txt', 'pip_requirements.txt']
LICENSE = 'new BSD'
setup_dict = dict(
name=module_name,
version=__version__,
description='Univariate Voxel Analysis and Correlations Tools',
license='BSD 3-Clause',
author='Alexandre M. Savio',
author_email='[email protected]',
maintainer='Alexandre M. Savio',
maintainer_email='[email protected]',
packages=find_packages(),
install_requires=get_requirements(*req_files),
extra_files=['CHANGES.rst', 'LICENSE', 'README.rst'],
long_description=read('README.rst', 'CHANGES.rst'),
platforms='Linux/MacOSX',
#https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Console',
'Intended Audience :: Healthcare Industry',
'License :: OSI Approved ::' + LICENSE,
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Medical Science Apps.',
'Topic :: Scientific/Engineering :: Information Analysis',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
extras_require={
'testing': ['pytest', 'pytest-cov'],
}
)
# Python3 support keywords
if sys.version_info >= (3,):
setup_dict['use_2to3'] = False
setup_dict['convert_2to3_doctests'] = ['']
setup_dict['use_2to3_fixers'] = ['']
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup_dict.update(dict(tests_require=['pytest'],
cmdclass={'test': PyTest}))
if __name__ == '__main__':
setup(**setup_dict)