Skip to content

Commit

Permalink
Distribute patched potion-client with onecodex (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
polyatail committed Nov 15, 2018
1 parent c9c0080 commit dafd69d
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 925 deletions.
7 changes: 3 additions & 4 deletions onecodex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import warnings
import errno

from onecodex.vendor.potion_client import Client as PotionClient
from onecodex.vendor.potion_client.converter import PotionJSONSchemaDecoder,
PotionJSONDecoder, PotionJSONEncoder
from onecodex.vendor.potion_client.utils import upper_camel_case
from requests.auth import HTTPBasicAuth

from onecodex.vendor.potion_client import Client as PotionClient
from onecodex.vendor.potion_client.converter import PotionJSONSchemaDecoder, PotionJSONDecoder, PotionJSONEncoder
from onecodex.vendor.potion_client.utils import upper_camel_case
from onecodex.lib.auth import BearerTokenAuth
from onecodex.models import _model_lookup
from onecodex.utils import ModuleAlias, get_raven_client, collapse_user
Expand Down
7 changes: 1 addition & 6 deletions onecodex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

from onecodex.utils import (cli_resource_fetcher, download_file_helper,
valid_api_key, OPTION_HELP, pprint, pretty_errors,
warn_if_insecure_platform, is_simplejson_installed,
warn_simplejson, telemetry)
warn_if_insecure_platform, telemetry)
from onecodex.api import Api
from onecodex.exceptions import (ValidationWarning,
ValidationError, UploadException)
Expand Down Expand Up @@ -63,10 +62,6 @@ def onecodex(ctx, api_key, no_pprint, verbose, telemetry):
if verbose:
log.setLevel(logging.INFO)

# Show a warning if simplejson is installed
if is_simplejson_installed():
warn_simplejson()

# handle checking insecure platform, we let upload command do it by itself
if ctx.invoked_subcommand != "upload":
warn_if_insecure_platform()
Expand Down
4 changes: 2 additions & 2 deletions onecodex/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from dateutil.parser import parse
import pytz
from requests.exceptions import HTTPError
from onecodex.vendor.potion_client.converter import PotionJSONEncoder
from onecodex.vendor.potion_client.resource import Resource
import six

from onecodex.vendor.potion_client.converter import PotionJSONEncoder
from onecodex.vendor.potion_client.resource import Resource
from onecodex.exceptions import MethodNotSupported, PermissionDenied, ServerError
from onecodex.models.helpers import (check_bind, generate_potion_sort_clause,
generate_potion_keyword_where)
Expand Down
2 changes: 1 addition & 1 deletion onecodex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import requests
from click import BadParameter, Context, echo
from onecodex.vendor.potion_client.converter import PotionJSONEncoder

from onecodex.vendor.potion_client.converter import PotionJSONEncoder
from onecodex.exceptions import OneCodexException, UploadException
from onecodex.version import __version__

Expand Down
5 changes: 5 additions & 0 deletions onecodex/vendor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Modules created by others. Versioned and distributed by One Codex
"""

__all__ = ['potion_client']
11 changes: 6 additions & 5 deletions onecodex/vendor/potion_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# flake8: noqa
from functools import partial
from operator import getitem, delitem, setitem
from six.moves.urllib.parse import urlparse, urljoin
from weakref import WeakValueDictionary
import collections
import requests

from potion_client.converter import PotionJSONDecoder, PotionJSONSchemaDecoder
from potion_client.resource import Reference, Resource, uri_for
from potion_client.links import Link
from potion_client.utils import upper_camel_case, snake_case
from .converter import PotionJSONDecoder, PotionJSONSchemaDecoder
from .resource import Reference, Resource, uri_for
from .links import Link
from .utils import upper_camel_case, snake_case


class Client(object):
Expand Down Expand Up @@ -144,4 +145,4 @@ def resource_factory(self, name, schema, resource_cls=None):


ASC = ASCENDING = False
DESC = DESCENDING = True
DESC = DESCENDING = True
3 changes: 2 additions & 1 deletion onecodex/vendor/potion_client/collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# flake8: noqa
import collections
from pprint import pformat

from potion_client.utils import escape
from .utils import escape


class PaginatedList(collections.Sequence):
Expand Down
2 changes: 1 addition & 1 deletion onecodex/vendor/potion_client/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from six.moves.urllib.parse import urljoin
import six

from potion_client.resource import Reference
from .resource import Reference

try:
from datetime import timezone
Expand Down
8 changes: 4 additions & 4 deletions onecodex/vendor/potion_client/links.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
try:
import simplejson as json
except ImportError:
Expand All @@ -7,10 +8,9 @@
from requests import Request
from requests.exceptions import HTTPError

from potion_client import PotionJSONDecoder
from potion_client.collection import PaginatedList
from potion_client.converter import PotionJSONEncoder
from potion_client.schema import Schema
from .collection import PaginatedList
from .converter import PotionJSONEncoder, PotionJSONDecoder
from .schema import Schema


class Link(object):
Expand Down
4 changes: 2 additions & 2 deletions onecodex/vendor/potion_client/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import six

from potion_client.exceptions import ItemNotFound, MultipleItemsFound
from potion_client.utils import escape
from .exceptions import ItemNotFound, MultipleItemsFound
from .utils import escape


def uri_for(reference):
Expand Down
Loading

0 comments on commit dafd69d

Please sign in to comment.