-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup.py
More file actions
63 lines (56 loc) · 1.91 KB
/
setup.py
File metadata and controls
63 lines (56 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
__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 = 'WarpedVisualStim'
# 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, 'WarpedVisualStim', '__init__.py'))
# setup
setup(
name='WarpedVisualStim',
version = version,
url='https://github.com/zhuangjun1981/WarpedVisualStim',
author='Jun Zhuang @ Allen Institute for Brain Science',
install_requires=install_reqs,
author_email='junz@alleninstitute.org',
description='visual stimulus display tools',
long_description=long_description,
packages=find_packages(),
include_package_data=True,
package_data={'':['*.md']},
platforms='any',
classifiers=['Programming Language :: Python',
'Development Status :: 4 - Beta',
'Natural Language :: English',
'Operating System :: OS Independent',],
)