-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
59 lines (49 loc) · 1.66 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
# encoding: utf8
import re
from setuptools import setup
def _cut_version_number_from_requirement(req):
return req.split()[0]
def read_metadata(metadata_str):
"""
Find __"meta"__ in init file.
"""
with open("./dopp/__init__.py", "r") as f:
meta_match = re.search(fr"^__{metadata_str}__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
if meta_match:
return meta_match.group(1)
raise RuntimeError(f"Unable to find __{metadata_str}__ string.")
def read_requirements():
requirements = []
with open("./requirements.txt") as f:
for req in f:
req = req.replace("\n", " ")
requirements.append(req)
return requirements
def read_long_description():
with open("README.md", "r") as f:
descr = f.read()
return descr
setup(
name="dopp",
version=read_metadata("version"),
maintainer=read_metadata("maintainer"),
author=read_metadata("author"),
description=(read_metadata("description")),
license=read_metadata("license"),
keywords=("simulation", "neuronal networks", "dendritic computation", "synaptic plasticity"),
url=read_metadata("url"),
python_requires=">=3.6, <4",
install_requires=read_requirements(),
packages=["dopp"],
long_description=read_long_description(),
long_description_content_type="text/x-rst",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering",
],
)