Skip to content

Commit

Permalink
update setup.py (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 authored Apr 16, 2022
2 parents 85b6df4 + 39759fb commit c7d59df
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

from setuptools import find_packages
from setuptools import setup
from pip._internal.utils.compat import stdlib_pkgs
from typing import cast

# --------------For pip install backup plan--------------

# from pip._internal.utils.compat import stdlib_pkgs
# from typing import cast
# def get_installed_distributions(
# local_only: bool = True,
# skip = stdlib_pkgs,
Expand Down Expand Up @@ -38,25 +38,26 @@
# )
# return [cast(_Dist, dist)._dist for dist in dists]

# [i.key for i in get_installed_distributions()]

# ----------------------------------------------------

try:
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 package "brainpy-simulator" first. \n'
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(f'Please uninstall the older version {i.version} of '
f'brainpy package "brain-py" first. \n'
f'>>> pip uninstall brain-py {i.location}')
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:
Expand Down Expand Up @@ -86,6 +87,9 @@
extras_require={
'cpu': ['jaxlib>=0.3.0', 'brainpylib>=0.0.4'],
'cuda': ['jaxlib>=0.3.0', 'brainpylib>=0.0.4'],
'all': ['jaxlib>=0.3.0', 'brainpylib>=0.0.4',
'numba>=0.50', 'scipy>=1.1.0',
'networkx', 'matplotlib']
},
url='https://github.com/PKU-NIP-Lab/BrainPy',
keywords='computational neuroscience, '
Expand Down

0 comments on commit c7d59df

Please sign in to comment.