From 075af4e4d1ab5d052eb3073c4df7555227ff2b24 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Mon, 14 Mar 2022 15:08:55 +0100 Subject: [PATCH] Release 0.10.0 --- MANIFEST | 10 ------ MANIFEST.in | 5 +++ doc/conf.py | 4 +-- nmpi/__init__.py | 2 +- nmpi/psa-oauth2.py | 79 ---------------------------------------------- setup.py | 5 ++- 6 files changed, 10 insertions(+), 95 deletions(-) delete mode 100644 MANIFEST create mode 100644 MANIFEST.in delete mode 100644 nmpi/psa-oauth2.py diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index e8d7fdf..0000000 --- a/MANIFEST +++ /dev/null @@ -1,10 +0,0 @@ -# This file contains the list of files that should be distributed in the PyPI package. -# The PyPI package does not contain the HardwareClient or AdminClient. -README.md -LICENCE.txt -requirements.txt -setup.py -nmpi/__init__.py -nmpi/nmpi_user.py -nmpi/cli.py -test/test_client.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f591164 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +# This file contains the list of files that should be excluded from the PyPI package. +# The PyPI package does not contain the HardwareClient or AdminClient. +exclude nmpi/nmpi_saga.py +exclude nmpi/nmpi_admin.py +exclude test/test_saga_client.py diff --git a/doc/conf.py b/doc/conf.py index bba66ff..b114e6f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -56,9 +56,9 @@ # built documents. # # The short X.Y version. -version = '0.10.0' +version = '0.10' # The full version, including alpha/beta/rc tags. -release = '0.10.0.dev' +release = '0.10.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/nmpi/__init__.py b/nmpi/__init__.py index a269f72..72e7b03 100644 --- a/nmpi/__init__.py +++ b/nmpi/__init__.py @@ -15,4 +15,4 @@ ESS = "BrainScaleS-ESS" SPIKEY = "Spikey" -__version__ = "0.9.1" +__version__ = "0.10.0" diff --git a/nmpi/psa-oauth2.py b/nmpi/psa-oauth2.py deleted file mode 100644 index 26fd946..0000000 --- a/nmpi/psa-oauth2.py +++ /dev/null @@ -1,79 +0,0 @@ -import requests -import getpass - -# In any case, the first time it has to be done through the web interface -# to choose and accept the type of access. - -# base_url = r"https://accounts.google.com/o/oauth2/" -base_url = r"https://www.hbpneuromorphic.eu/" - - -s = requests.Session() - -# 1. login button on NMPI -rNMPI1 = s.get(base_url + "login/hbp-oauth2/?next=/", allow_redirects=False, verify=False) - -# 2. receives a redirect -if rNMPI1.status_code == 302: - # Get its new destination (location) - url = rNMPI1.headers.get('location') - # https://services.humanbrainproject.eu/oidc/authorize? - # scope=openid%20profile - # state=jQLERcgK1xTDHcxezNYnbmLlXhHgJmsg - # redirect_uri=https://neuromorphic.humanbrainproject.eu/complete/hbp-oauth2/ - # response_type=code - # client_id=nmpi - # get the exchange cookie - cookie = rNMPI1.headers.get('set-cookie').split(";")[0] - s.headers.update({'cookie': cookie}) - # 3. request to the provided url at HBP - rHBP1 = s.get(url, allow_redirects=False, verify=False) - - # 4. receives a redirect to HBP login page - if rHBP1.status_code == 302: - # Get its new destination (location) - url = rHBP1.headers.get('location') - cookie = rHBP1.headers.get('set-cookie').split(";")[0] - s.headers.update({'cookie': cookie}) - - # 5. request to the provided url at HBP - rHBP2 = s.get(url, allow_redirects=False, verify=False) - - # 6. HBP responds with the auth form - if rHBP2.text: - # Gather user credentials - user = raw_input('Username:') - pssw = getpass.getpass('Password:') - - # 7. Request to the auth service url - formdata = { - 'j_username': user, - 'j_password': pssw, - 'submit': 'Login', - 'redirect_uri': 'https://www.hbpneuromorphic.eu/complete/hbp-oauth2/&response_type=code&client_id=nmpi' - } - headers = {'accept': 'application/json'} - rNMPI2 = s.post("https://services.humanbrainproject.eu/oidc/j_spring_security_check", - data=formdata, - allow_redirects=True, - verify=False, - headers=headers) - - # check good communication - if rNMPI2.status_code == requests.codes.ok: - - # check success address - if rNMPI2.url == base_url: - # print rNMPI2.text - res = rNMPI2.json() - print res['username'] - print res['access_token'] - - # unauthorized - else: - if 'error' in rNMPI2.url: - print "Authentication Failure: No token retrieved." - else: - print "Unhandeled error in Authentication" - else: - print "Communication error" diff --git a/setup.py b/setup.py index aa392f4..36c65b7 100644 --- a/setup.py +++ b/setup.py @@ -6,8 +6,7 @@ requirements = [ 'requests', 'click', - 'pyyaml', - 'validators' + 'pyyaml' ] test_requirements = [ @@ -18,7 +17,7 @@ setup( name="hbp_neuromorphic_platform", - version='0.10.0.dev', + version='0.10.0', packages=['nmpi'], package_dir={'nmpi': 'nmpi'}, entry_points={