-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
81 lines (68 loc) · 2.39 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
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
from shutil import copy2
# load README.md/README.rst file
try:
if os.path.exists('README.md'):
with open('README.md', 'r') as fp:
readme = fp.read()
readme_type = 'text/markdown; charset=UTF-8'
elif os.path.exists('README.rst'):
with open('README.rst', 'r') as fp:
readme = fp.read()
readme_type = 'text/x-rst; charset=UTF-8'
else:
readme = ""
except Exception:
readme = ""
def open_requirements(fname):
with open(fname, mode='r') as f:
requires = f.read().split('\n')
requires = [e for e in requires if len(e) > 0 and not e.startswith('#')]
return requires
install_requires = open_requirements('requirements.txt')
d = {}
exec(open("src/pynwb/ndx_probeinterface/version.py").read(), None, d)
version = d['version']
setup_args = {
'name': 'ndx-probeinterface',
'version': version,
'description': 'Extension for defining neural probes in the probeinterface format',
'long_description': readme,
'long_description_content_type': readme_type,
'author': 'Alessio Buccino, Kyu Hyun Lee, Geeling Chau',
'author_email': '[email protected]',
'url': '',
'license': 'MIT',
'install_requires': install_requires,
'packages': find_packages('src/pynwb', exclude=["tests", "tests.*"]),
'package_dir': {'': 'src/pynwb'},
'package_data': {'ndx_probeinterface': [
'spec/ndx-probeinterface.namespace.yaml',
'spec/ndx-probeinterface.extensions.yaml',
]},
'classifiers': [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License"
],
'keywords': [
'NeurodataWithoutBorders',
'NWB',
'nwb-extension',
'ndx-extension'
],
'zip_safe': False
}
def _copy_spec_files(project_dir):
ns_path = os.path.join(project_dir, 'spec', 'ndx-probeinterface.namespace.yaml')
ext_path = os.path.join(project_dir, 'spec', 'ndx-probeinterface.extensions.yaml')
dst_dir = os.path.join(project_dir, 'src', 'pynwb', 'ndx_probeinterface', 'spec')
if not os.path.exists(dst_dir):
os.mkdir(dst_dir)
copy2(ns_path, dst_dir)
copy2(ext_path, dst_dir)
if __name__ == '__main__':
_copy_spec_files(os.path.dirname(__file__))
setup(**setup_args)