Skip to content

Commit

Permalink
Chore/python3 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre authored Jul 2, 2019
1 parent e03acd1 commit da1131f
Show file tree
Hide file tree
Showing 15 changed files with 381 additions and 291 deletions.
9 changes: 9 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
workflow "Run python formatter" {
on = "pull_request"
resolves = ["Run wool"]
}

action "Run wool" {
uses = "uc-cdis/wool@master"
secrets = ["GITHUB_TOKEN"]
}
27 changes: 9 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
---
language: python

python:
- "2.7"
- "3.6"

- '2.7'
- '3.6'
matrix:
allow_failures:
- python: "3.6"

- python: '2.7'
sudo: false

cache: pip

install:
- pip install --upgrade setuptools
- pip install -r requirements.txt
- python setup.py install
- pip install -r dev-requirements.txt

- pip install --upgrade setuptools
- pip install -r requirements.txt
- python setup.py install
- pip install -r dev-requirements.txt
before_script:
- sudo rm -f /etc/boto.cfg

- sudo rm -f /etc/boto.cfg
script:
- nosetests -v test/test_cleversafe_api_client.py
- pytest test/test_google_api_client.py -vv
- pytest -vv test
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mock==2.0.0
nose==1.3.7
rsa==3.4.2
pytest>=3.0
git+https://git@github.com/uc-cdis/cdisutils-test.git@0.2.5#egg=cdisutilstest-0.2.5
git+https://git@github.com/uc-cdis/cdisutils-test.git@1.0.0#egg=cdisutilstest
21 changes: 21 additions & 0 deletions pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Description about what this pull request does.

Please make sure to follow the [DEV guidelines](https://gen3.org/resources/developer/dev-introduction/) before asking for review.

### New Features
- Implemented XXX

### Breaking Changes


### Bug Fixes


### Improvements


### Dependency updates


### Deployment changes

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
gen3cirrus==0.3.0
-e git+https://github.com/uc-cdis/cdislogging.git@master#egg=cdislogging
cdislogging==1.0.0
gen3cirrus==1.0.0
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
license="Apache",
packages=find_packages(),
install_requires=[
'boto>=2.36.0,<3.0.0',
'botocore>=1.7,<1.9.0',
'requests>=2.5.2,<3.0.0',
's3transfer==0.1.10',
'jmespath==0.9.2',
'pbr==2.0.0',
'cdislogging',
'gen3cirrus>=0.3.0,<1.0.0',
]
"boto>=2.36.0,<3.0.0",
"botocore>=1.7,<1.9.0",
"requests>=2.5.2,<3.0.0",
"s3transfer==0.1.10",
"jmespath==0.9.2",
"pbr==2.0.0",
"cdislogging",
"gen3cirrus>=1.0.0,<2.0.0",
],
)
9 changes: 4 additions & 5 deletions storageclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

def get_client(config=None, backend=None):
try:
clients = {
'cleversafe': CleversafeClient,
'google': GoogleCloudStorageClient
}
clients = {"cleversafe": CleversafeClient, "google": GoogleCloudStorageClient}
return clients[backend](config)
except KeyError as ex:
raise NotImplementedError("The input storage is currently not supported!: {0}".format(ex))
raise NotImplementedError(
"The input storage is currently not supported!: {0}".format(ex)
)
7 changes: 3 additions & 4 deletions storageclient/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import abstractmethod, abstractproperty, ABCMeta
from errors import ClientSideError
from .errors import ClientSideError
import logging
from cdislogging import get_logger

Expand All @@ -20,14 +20,13 @@ def wrapper(self, *args, **kwargs):
return fun(self, *args, **kwargs)
except Exception as req_exception:
self.logger.exception("internal error")
raise ClientSideError(req_exception.message)
raise ClientSideError(str(req_exception))

return wrapper


class StorageClient(object):
class StorageClient(object, metaclass=ABCMeta):
"""Abstract storage client class"""
__metaclass__ = ABCMeta

def __init__(self, cls_name):
self.logger = get_logger(cls_name)
Expand Down
Loading

0 comments on commit da1131f

Please sign in to comment.