-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
40 lines (33 loc) · 1.2 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
"""
This file installs the LSNN package.
"""
import re
from setuptools import setup, find_packages
__author__ = "Guillaume Bellec, Darjan Salaj, Anand Subramoney"
__version__ = "1.0.6"
def get_requirements(filename):
"""
Helper function to read the list of requirements from a file
"""
dependency_links = []
with open(filename) as requirements_file:
requirements = requirements_file.read().strip('\n').splitlines()
for i, req in enumerate(requirements):
if ':' in req:
match_obj = re.match(r"git\+(?:https|ssh|http):.*#egg=(.*)-(.*)", req)
assert match_obj, "Cannot make sense of url {}".format(req)
requirements[i] = "{req}=={ver}".format(req=match_obj.group(1), ver=match_obj.group(2))
dependency_links.append(req)
return requirements, dependency_links
requirements, dependency_links = get_requirements('requirements.txt')
setup(
name="LSNN",
version=__version__,
packages=find_packages('.'),
author=__author__,
author_email="[email protected]",
description="Recurrent Spiking Neural Network (LSNN)",
provides=['lsnn'],
install_requires=requirements,
dependency_links=dependency_links,
)