Skip to content
Snippets Groups Projects
Commit fbe099e6 authored by Viktor Vorobev's avatar Viktor Vorobev
Browse files

Merged in NRRPLT-8846-remove-pip-in-setup (pull request #37)

NRRPLT-8846 remove pip in setup

* [NRRPLT-8846] Get rid of obsolete pip workarounds

* [NRRPLT-8847] update Acknowledgments
parent 96ba554c
No related branches found
No related tags found
No related merge requests found
This repository is part of the Neurorobotics Platform software
Copyright (C) Human Brain Project
https://neurorobotics.ai
https://neurorobotics.net
The Human Brain Project is a European Commission funded project
in the frame of the [Horizon2020 FET Flagship plan](http://ec.europa.eu/programmes/horizon2020/en/h2020-section/fet-flagships).
This work has received funding from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 720270 (Human Brain Project SGA1), and the Specific Grant Agreement No. 785907 (Human Brain Project SGA2), and under the Specific Grant Agreement No. 945539 (Human Brain Project SGA3).
You are free to clone this repository and amend its code with respect to
the license that you find in the root folder.
......
'''setup.py'''
from builtins import next
from setuptools import setup
import hbp_nrp_distributed_nest
import pip
from optparse import Option # pylint:disable=deprecated-module
options = Option('--workaround')
options.skip_requirements_regex = None
reqs_file = './requirements.txt'
pip_version_major = int(pip.__version__.split('.')[0])
# Hack for old pip versions
if pip_version_major == 1:
# Versions 1.x rely on pip.req.parse_requirements
# but don't require a "session" parameter
from pip.req import parse_requirements # pylint:disable=no-name-in-module, import-error
install_reqs = parse_requirements(reqs_file, options=options)
reqs = [str(ir.req) for ir in install_reqs]
elif 10 > pip_version_major > 1:
# Versions greater than 1.x but smaller than 10.x rely on pip.req.parse_requirements
# and requires a "session" parameter
from pip.req import parse_requirements # pylint:disable=no-name-in-module, import-error
from pip.download import PipSession # pylint:disable=no-name-in-module, import-error
options.isolated_mode = False
install_reqs = parse_requirements( # pylint:disable=unexpected-keyword-arg
reqs_file,
session=PipSession,
options=options
)
reqs = [str(ir.req) for ir in install_reqs]
elif pip_version_major >= 10:
# Versions greater or equal to 10.x don't rely on pip.req.parse_requirements
install_reqs = list(val.strip() for val in open(reqs_file))
reqs = install_reqs
# ensure we install numpy before the main list of requirements, ignore
# failures if numpy/cython are not requirements and just proceed (future proof)
try:
cython_req = next(r for r in reqs if r.startswith('cython'))
numpy_req = next(r for r in reqs if r.startswith('numpy'))
if pip.__version__.startswith('10.'):
import subprocess
subprocess.check_call(
["python", '-m', 'pip', 'install', "--no-clean", "--user", cython_req, numpy_req]
)
else:
pip.main(['install', '--no-clean', cython_req, numpy_req]) # pylint:disable=no-member
# pylint: disable=bare-except
except:
pass
# Get the list of requirements
install_reqs = list(val.strip() for val in open(reqs_file))
reqs = install_reqs
config = {
'description': 'Distributed Nest interface support for CLE/ExDBackend for HBP SP10',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment