-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (58 loc) · 1.91 KB
/
setup.py
File metadata and controls
66 lines (58 loc) · 1.91 KB
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
__author__ = 'junz'
import sys
import io
import os
import codecs
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
os.chdir(here)
package_root = 'NeuroAnalysisTools'
# get install requirements
with open('requirements.txt') as req_f:
install_reqs = req_f.read().splitlines()
install_reqs = [ir for ir in install_reqs if '#' not in ir]
install_reqs = install_reqs[::-1]
print('\ninstall requirements:')
print('\n'.join(install_reqs))
print('')
# get long_description
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)
long_description = read('README.md')
# find version
def find_version(f_path):
version_file = codecs.open(f_path, 'r').read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
version = find_version(os.path.join(here, 'NeuroAnalysisTools', '__init__.py'))
setup(
name='NeuroAnalysisTools',
version=version,
python_requires='>3.0',
url='https://github.com/zhuangjun1981/NeuroAnalysisTools.git',
author='Jun Zhuang',
install_requires=install_reqs,
author_email='junz@alleninstitute.org',
description='Data analysis tools for systems neuroscience',
long_description=long_description,
packages=find_packages(),
include_package_data=True,
package_data={'':['*.md', '*.txt', '*.hdf5', 'spec*.json']},
platforms='any',
classifiers=[
'Programming Language :: Python',
'Development Status :: 4 - Beta',
'Natural Language :: English',
'Operating System :: OS Independent',
],
)