|
3 | 3 | import io |
4 | 4 | import os |
5 | 5 | import re |
6 | | -import time |
7 | | -import sys |
8 | | - |
9 | | -from setuptools import find_packages |
10 | | -from setuptools import setup |
11 | | - |
12 | | -try: |
13 | | - # require users to uninstall previous brainpy releases. |
14 | | - import pkg_resources |
15 | | - |
16 | | - installed_packages = pkg_resources.working_set |
17 | | - for i in installed_packages: |
18 | | - if i.key == 'brainpy-simulator': |
19 | | - raise SystemError('Please uninstall the older version of brainpy ' |
20 | | - f'package "brainpy-simulator={i.version}" ' |
21 | | - f'(located in {i.location}) first. \n' |
22 | | - '>>> pip uninstall brainpy-simulator') |
23 | | - if i.key == 'brain-py': |
24 | | - raise SystemError('Please uninstall the older version of brainpy ' |
25 | | - f'package "brain-py={i.version}" ' |
26 | | - f'(located in {i.location}) first. \n' |
27 | | - '>>> pip uninstall brain-py') |
28 | | -except ModuleNotFoundError: |
29 | | - pass |
30 | 6 |
|
| 7 | +from setuptools import find_packages, setup |
31 | 8 |
|
32 | 9 | # version |
33 | 10 | here = os.path.abspath(os.path.dirname(__file__)) |
34 | 11 | with open(os.path.join(here, 'brainpy', '__init__.py'), 'r') as f: |
35 | | - init_py = f.read() |
| 12 | + init_py = f.read() |
36 | 13 | version = re.search('__version__ = "(.*)"', init_py).groups()[0] |
37 | | -if len(sys.argv) > 2 and sys.argv[2] == '--python-tag=py3': |
38 | | - version = version |
39 | | -else: |
40 | | - version += '.post{}'.format(time.strftime("%Y%m%d", time.localtime())) |
41 | 14 |
|
42 | 15 | # obtain long description from README |
43 | 16 | with io.open(os.path.join(here, 'README.md'), 'r', encoding='utf-8') as f: |
44 | | - README = f.read() |
| 17 | + README = f.read() |
45 | 18 |
|
46 | 19 | # installation packages |
47 | 20 | packages = find_packages(exclude=['lib*', 'docs', 'tests']) |
48 | 21 |
|
49 | 22 | # setup |
50 | 23 | setup( |
51 | | - name='brainpy', |
52 | | - version=version, |
53 | | - description='BrainPy: Brain Dynamics Programming in Python', |
54 | | - long_description=README, |
55 | | - long_description_content_type="text/markdown", |
56 | | - author='BrainPy Team', |
57 | | - author_email='chao.brain@qq.com', |
58 | | - packages=packages, |
59 | | - python_requires='>=3.10', |
60 | | - install_requires=['numpy>=1.15', 'jax>=0.4.13,<0.6.0', 'tqdm'], |
61 | | - url='https://github.com/brainpy/BrainPy', |
62 | | - project_urls={ |
63 | | - "Bug Tracker": "https://github.com/brainpy/BrainPy/issues", |
64 | | - "Documentation": "https://brainpy.readthedocs.io/", |
65 | | - "Source Code": "https://github.com/brainpy/BrainPy", |
66 | | - }, |
67 | | - dependency_links=[ |
68 | | - 'https://storage.googleapis.com/jax-releases/jax_cuda_releases.html', |
69 | | - ], |
70 | | - extras_require={ |
71 | | - 'cpu': ['jaxlib>=0.4.13', 'numba', 'braintaichi'], |
72 | | - 'cuda12': ['jaxlib[cuda12_pip]', 'numba', 'braintaichi'], |
73 | | - 'tpu': ['jaxlib[tpu]', 'numba',], |
74 | | - 'cpu_mini': ['jaxlib>=0.4.13'], |
75 | | - 'cuda12_mini': ['jaxlib[cuda12_pip]'], |
76 | | - }, |
77 | | - keywords=('computational neuroscience, ' |
78 | | - 'brain-inspired computation, ' |
79 | | - 'brain modeling, ' |
80 | | - 'brain dynamics modeling, ' |
81 | | - 'brain dynamics programming'), |
82 | | - classifiers=[ |
83 | | - 'Natural Language :: English', |
84 | | - 'Operating System :: OS Independent', |
85 | | - 'Programming Language :: Python', |
86 | | - 'Programming Language :: Python :: 3', |
87 | | - 'Programming Language :: Python :: 3.10', |
88 | | - 'Programming Language :: Python :: 3.11', |
89 | | - 'Programming Language :: Python :: 3.12', |
90 | | - 'Intended Audience :: Science/Research', |
91 | | - 'License :: OSI Approved :: Apache Software License', |
92 | | - 'Topic :: Scientific/Engineering :: Bio-Informatics', |
93 | | - 'Topic :: Scientific/Engineering :: Mathematics', |
94 | | - 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
95 | | - 'Topic :: Software Development :: Libraries', |
96 | | - ], |
97 | | - license='GPL-3.0 license', |
| 24 | + name='brainpy', |
| 25 | + version=version, |
| 26 | + description='BrainPy: Brain Dynamics Programming in Python', |
| 27 | + long_description=README, |
| 28 | + long_description_content_type="text/markdown", |
| 29 | + author='BrainPy Team', |
| 30 | + author_email='chao.brain@qq.com', |
| 31 | + packages=packages, |
| 32 | + python_requires='>=3.10', |
| 33 | + install_requires=['numpy>=1.15', 'jax', 'tqdm'], |
| 34 | + url='https://github.com/brainpy/BrainPy', |
| 35 | + project_urls={ |
| 36 | + "Bug Tracker": "https://github.com/brainpy/BrainPy/issues", |
| 37 | + "Documentation": "https://brainpy.readthedocs.io/", |
| 38 | + "Source Code": "https://github.com/brainpy/BrainPy", |
| 39 | + }, |
| 40 | + dependency_links=[ |
| 41 | + 'https://storage.googleapis.com/jax-releases/jax_cuda_releases.html', |
| 42 | + ], |
| 43 | + extras_require={ |
| 44 | + 'cpu': ['jax[cpu]<0.5.0', 'numba', 'braintaichi'], |
| 45 | + 'cuda12': ['jax[cuda12]<0.5.0', 'numba', 'braintaichi'], |
| 46 | + 'tpu': ['jax[tpu]<0.5.0', 'numba', ], |
| 47 | + }, |
| 48 | + keywords=('computational neuroscience, ' |
| 49 | + 'brain-inspired computation, ' |
| 50 | + 'brain modeling, ' |
| 51 | + 'brain dynamics modeling, ' |
| 52 | + 'brain dynamics programming'), |
| 53 | + classifiers=[ |
| 54 | + 'Natural Language :: English', |
| 55 | + 'Operating System :: OS Independent', |
| 56 | + 'Programming Language :: Python', |
| 57 | + 'Programming Language :: Python :: 3', |
| 58 | + 'Programming Language :: Python :: 3.10', |
| 59 | + 'Programming Language :: Python :: 3.11', |
| 60 | + 'Programming Language :: Python :: 3.12', |
| 61 | + 'Programming Language :: Python :: 3.13', |
| 62 | + 'Intended Audience :: Science/Research', |
| 63 | + 'License :: OSI Approved :: Apache Software License', |
| 64 | + 'Topic :: Scientific/Engineering :: Bio-Informatics', |
| 65 | + 'Topic :: Scientific/Engineering :: Mathematics', |
| 66 | + 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
| 67 | + 'Topic :: Software Development :: Libraries', |
| 68 | + ], |
| 69 | + license='GPL-3.0 license', |
98 | 70 | ) |
0 commit comments