-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
executable file
·132 lines (108 loc) · 5.8 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
124
125
126
127
128
129
130
131
132
#!/usr/bin/env python
# encoding: utf-8
###############################################################################
# #
# PyMICE library #
# #
# Copyright (C) 2014-2020 Jakub M. Dzik aka Kowalski (Laboratory of #
# Neuroinformatics; Nencki Institute of Experimental Biology of Polish #
# Academy of Sciences) #
# #
# This software 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. #
# #
# This software 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 this software. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
import os, sys, logging
def loadUTF8(path):
return open(path, encoding='utf-8').read()
def loadTextFrom(path):
return loadUTF8(os.path.join(os.path.dirname(__file__),
path))
SETUP_PARAMETERS = {
'name': 'PyMICE',
'version': loadTextFrom('lib/pymice/data/__version__.txt') + '.dev1',
'url': 'https://neuroinflab.wordpress.com/research/pymice/',
'description': 'PyMICE - a Python® library for mice behavioural data analysis',
'long_description': loadTextFrom('README.rst'),
'author': "Jakub M. Dzik a.k.a. Kowalski, S. Leski (Laboratory of Neuroinformatics; Nencki Institute of Experimental Biology)",
'author_email': "jakub.m.dzik+pymice@gmail.com, sz.leski+pymice@gmail.com",
'license': 'GPL3',
'classifiers': ['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Cython',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries :: Python Modules'],
'keywords': 'IntelliCage mice behavioural data loading analysis',
'packages': ['pymice',
'pymice._Python{.major}'.format(sys.version_info),
],
'package_dir': {'': 'lib'},
'package_data': {'pymice': ['data/tutorial/demo.zip',
'data/tutorial/LICENSE',
'data/tutorial/COPYING',
'data/tutorial/C57_AB/*.zip',
'data/tutorial/C57_AB/timeline.ini',
'data/tutorial/C57_AB/LICENSE',
'data/tutorial/C57_AB/COPYING',
'data/tutorial/FVB/*.zip',
'data/tutorial/FVB/timeline.ini',
'data/tutorial/FVB/LICENSE',
'data/tutorial/FVB/COPYING',
'data/__version__.txt',
]},
}
INSTALL_REQUIRES = loadTextFrom('requirements.txt').split()
WARNINGS = []
NO_SETUPTOOLS_WARNING = """
The setuptools package is not found - 'Unable to find vcvarsall.bat' error (and
many others) might occur.
Please ensure that the following dependencies are installed:
{}.
""".format(',\n'.join([' - {}'.format(dependency)
for dependency in INSTALL_REQUIRES]))
NO_CYTHON_WARNING = """
No Cython detected - installing only pure Python routines.
In order to install optimized Cython routines please install Cython and run
{} again.""".format(sys.argv[0])
try:
from setuptools import setup, Extension
# XXX a fix for https://bugs.python.org/issue23246 bug
except ImportError:
WARNINGS.append(NO_SETUPTOOLS_WARNING)
from distutils.core import setup, Extension
else:
SETUP_PARAMETERS['install_requires'] = INSTALL_REQUIRES
SETUP_PARAMETERS['python_requires'] = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4'
try:
from Cython.Build import cythonize
except ImportError:
WARNINGS.append(NO_CYTHON_WARNING)
else:
cPymice = Extension('pymice._cymice', sources=['_cymice.pyx'])
SETUP_PARAMETERS['ext_modules'] = cythonize([cPymice])
setup(**SETUP_PARAMETERS)
if WARNINGS:
for message in WARNINGS:
logging.warning("\nWARNING!!!\n{}\n".format(message))