-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
111 lines (87 loc) · 3.47 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
import io
import re
from setuptools import setup, find_packages
def read_file(filename, **kwargs):
encoding = kwargs.get("encoding", "utf-8")
with io.open(filename, encoding=encoding) as f:
return f.read()
def replace_local_hyperlinks(
text,
base_url="https://github.com/project-rig/pynn_spinnaker/blob/master/"
):
"""Replace local hyperlinks in RST with absolute addresses using the given
base URL.
This is used to make links in the long description function correctly
outside of the repository (e.g. when published on PyPi).
NOTE: This may need adjusting if further syntax is used.
"""
def get_new_url(url):
return base_url + url[2:]
# Deal with anonymous URLS
for match in re.finditer(r"^__ (?P<url>\./.*)", text, re.MULTILINE):
orig_url = match.groupdict()["url"]
url = get_new_url(orig_url)
text = re.sub("^__ {}".format(orig_url),
"__ {}".format(url), text, flags=re.MULTILINE)
# Deal with named URLS
for match in re.finditer(r"^\.\. _(?P<identifier>[^:]*): (?P<url>\./.*)",
text, re.MULTILINE):
identifier = match.groupdict()["identifier"]
orig_url = match.groupdict()["url"]
url = get_new_url(orig_url)
text = re.sub(
"^\.\. _{}: {}".format(identifier, orig_url),
".. _{}: {}".format(identifier, url),
text, flags=re.MULTILINE)
# Deal with image URLS
for match in re.finditer(r"^\.\. image:: (?P<url>\./.*)",
text, re.MULTILINE):
orig_url = match.groupdict()["url"]
url = get_new_url(orig_url)
text = text.replace(".. image:: {}".format(orig_url),
".. image:: {}".format(url))
return text
setup(
name="pynn_spinnaker",
version="0.4.0",
packages=find_packages(),
package_data={'pynn_spinnaker': ['model_binaries/*.aplx']},
# Metadata for PyPi
url="https://github.com/project-rig/pynn_spinnaker",
author="University of Manchester",
description="Tools for simulating neural models generated using PyNN 0.8 on "
"the SpiNNaker platform",
#long_description=replace_local_hyperlinks(read_file("README.rst")),
license="GPLv2",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Topic :: Scientific/Engineering",
],
keywords="spinnaker pynn neural simulation",
# Requirements
install_requires=["neo>=0.3.0, <0.4.0",
"lazyarray>=0.2.0, <0.3.0",
"pynn>=0.8", "rig>=2.0.0, <3.0.0",
"rig_cpp_common>=0.1.0, <0.2.0",
"bitarray>=0.8.1, <1.0.0"],
zip_safe=False, # Partly for performance reasons
# Scripts
entry_points={
"console_scripts": [
"pynn_spinnaker_path = pynn_spinnaker.scripts.pynn_spinnaker_path:main",
],
},
# Extras
extras_require={
"spalloc": ["spalloc >= 0.2.4"], # For machine allocation
},
)