-
Notifications
You must be signed in to change notification settings - Fork 53
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
UIP-47: update clients #3556
UIP-47: update clients #3556
Conversation
…ingleton directories with the different clients in them.
@@ -1,3 +1,4 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes in this file are due to running kb-sdk install catalog
- the client has been updated since whenever this file was last touched.
@@ -0,0 +1,94 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from a freshly generated kbase SDK module
except ImportError: | ||
from urlparse import urlparse as _urlparse # py2 | ||
|
||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually from a freshly-generated KBase sdk app with some typing stuff added.
from biokbase.installed_clients.CatalogClient import Catalog | ||
from biokbase.installed_clients.execution_engine2Client import execution_engine2 | ||
from biokbase.installed_clients.NarrativeMethodStoreClient import NarrativeMethodStore | ||
from biokbase.installed_clients.ServiceClient import Client as ServiceClient | ||
from biokbase.installed_clients.WorkspaceClient import Workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all clients now in the installed_clients folder
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3556 +/- ##
===========================================
+ Coverage 29.69% 29.70% +0.01%
===========================================
Files 496 496
Lines 50444 50444
===========================================
+ Hits 14977 14984 +7
+ Misses 35467 35460 -7
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
"""Retrieve the client for a KBase service.""" | ||
return __init_client(client_name, token=token) | ||
|
||
|
||
def __init_client(client_name, token=None): | ||
@cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache the clients
@@ -9,8 +9,8 @@ | |||
from lib2to3.refactor import RefactoringTool, get_fixers_from_package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this script and its test even worth keeping any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope not!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was really used to notify users who had py2 code in their narratives way back before some major Python / IPython version switchover to make those fail. I think it hit single-digits of non-KBase-staff.
@@ -12,8 +12,8 @@ | |||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this script still a going concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think so. We should put it somewhere for reference, but it doesn't need to be maintained.
+ "&fields=token" | ||
) | ||
ret = _requests.post(auth_svc, data=body, allow_redirects=True) | ||
body = "user_id=" + quote(user_id) + "&password=" + quote(password) + "&fields=token" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests.utils.quote
is just a wrapper around url lib.parse.quote
, so use the latter as the former has been deprecated.
|
||
from biokbase.workspace.baseclient import ServerError | ||
from biokbase.installed_clients.baseclient import ServerError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new location for the base client file for importing ServerErrors from
from biokbase.workspace.baseclient import ServerError | ||
|
||
from .exceptions import WorkspaceError | ||
from biokbase.narrative.common.exceptions import ServerError, WorkspaceError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get server errors from the kbase exceptions file so that if (for whatever reason) the ServerErrors got moved, the import statement in exceptions.py
could be updated and nothing else would need to be touched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's the right way.
adding some python updates that didn't make it into the previous PR updating that accursed release notes file
a5916dc
to
aa67a64
Compare
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on the consolidation and updates.
from biokbase.workspace.baseclient import ServerError | ||
|
||
from .exceptions import WorkspaceError | ||
from biokbase.narrative.common.exceptions import ServerError, WorkspaceError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's the right way.
@@ -12,8 +12,8 @@ | |||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think so. We should put it somewhere for reference, but it doesn't need to be maintained.
@@ -9,8 +9,8 @@ | |||
from lib2to3.refactor import RefactoringTool, get_fixers_from_package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope not!
@@ -9,8 +9,8 @@ | |||
from lib2to3.refactor import RefactoringTool, get_fixers_from_package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was really used to notify users who had py2 code in their narratives way back before some major Python / IPython version switchover to make those fail. I think it hit single-digits of non-KBase-staff.
Description of PR purpose/changes
Commit 1:
Commit 2:
kb-sdk install <client_name>
installed_clients
directory and removes all the duplicatedbase client.py
files.Commit 3:
Jira Ticket / Issue
Related Jira ticket: https://kbase-jira.atlassian.net/browse/UIP-47
DATAUP-69 Adds a PR template
)Testing Instructions
Dev Checklist:
format
andcheck
on changed Python code manually or with a git precommit hookUpdating Version and Release Notes (if applicable)
N/A