Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update setup.py #165

Merged
merged 1 commit into from
Apr 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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