Skip to content
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

Chore/python3 #23

Merged
merged 10 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@chore/python3#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

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cdislogging==1.0.0
gen3cirrus==0.3.0
-e git+https://github.com/uc-cdis/cdislogging.git@master#egg=cdislogging
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>=0.3.0,<1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure you update this to compatible cirrus

],
)
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