-
Notifications
You must be signed in to change notification settings - Fork 94
/
setup.py
101 lines (92 loc) · 3.48 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
# -*- coding: utf-8 -*-
import io
import os
import re
import time
import sys
from setuptools import find_packages
from setuptools import setup
try:
# require users to uninstall previous brainpy releases.
import pkg_resources
installed_packages = pkg_resources.working_set
for i in installed_packages:
if i.key == 'brainpy-simulator':
raise SystemError('Please uninstall the older version of brainpy '
f'package "brainpy-simulator={i.version}" '
f'(located in {i.location}) first. \n'
'>>> pip uninstall brainpy-simulator')
if i.key == 'brain-py':
raise SystemError('Please uninstall the older version of brainpy '
f'package "brain-py={i.version}" '
f'(located in {i.location}) first. \n'
'>>> pip uninstall brain-py')
except ModuleNotFoundError:
pass
# version
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'brainpy', '__init__.py'), 'r') as f:
init_py = f.read()
version = re.search('__version__ = "(.*)"', init_py).groups()[0]
if len(sys.argv) > 2 and sys.argv[2] == '--python-tag=py3':
version = version
else:
version += '.post{}'.format(time.strftime("%Y%m%d", time.localtime()))
# obtain long description from README
with io.open(os.path.join(here, 'README.md'), 'r', encoding='utf-8') as f:
README = f.read()
# installation packages
packages = find_packages(exclude=['lib*', 'docs', 'tests'])
# setup
setup(
name='brainpy',
version=version,
description='BrainPy: Brain Dynamics Programming in Python',
long_description=README,
long_description_content_type="text/markdown",
author='BrainPy Team',
author_email='[email protected]',
packages=packages,
python_requires='>=3.9',
install_requires=['numpy>=1.15', 'jax>=0.4.13', 'tqdm'],
url='https://github.com/brainpy/BrainPy',
project_urls={
"Bug Tracker": "https://github.com/brainpy/BrainPy/issues",
"Documentation": "https://brainpy.readthedocs.io/",
"Source Code": "https://github.com/brainpy/BrainPy",
},
dependency_links=[
'https://storage.googleapis.com/jax-releases/jax_cuda_releases.html',
],
extras_require={
'cpu': ['jaxlib>=0.4.13', 'brainpylib', 'numba', 'taichi==1.7.0'],
'cuda11': ['jaxlib[cuda11_pip]', 'brainpylib', 'numba', 'taichi==1.7.0'],
'cuda12': ['jaxlib[cuda12_pip]', 'brainpylib', 'numba', 'taichi==1.7.0'],
'tpu': ['jaxlib[tpu]', 'numba',],
'cpu_mini': ['jaxlib>=0.4.13'],
'cuda11_mini': ['jaxlib[cuda11_pip]'],
'cuda12_mini': ['jaxlib[cuda12_pip]'],
},
keywords=('computational neuroscience, '
'brain-inspired computation, '
'brain modeling, '
'brain dynamics modeling, '
'brain dynamics programming'),
classifiers=[
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development :: Libraries',
],
license='GPL-3.0 license',
)