Skip to content

Commit 0979c2a

Browse files
authored
Merge pull request #211 from josephroque/2017-07-env-fixes
July 2017, Pylint/Test environment fixes
2 parents 6597e93 + f2ef614 commit 0979c2a

23 files changed

+38
-33
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ matrix:
2323
- python: 3.6
2424
env: TOX_ENV=py36
2525
- python: pypy
26-
env: TOX_ENV=pypy PYPY_VERSION='4.0.0'
26+
env: TOX_ENV=pypy PYPY_VERSION='2.7-5.8.0'
2727
- python: 2.7
2828
env: TOX_ENV=pep8
2929
- python: 2.7

.travis/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
4646
pyenv global 3.6.0
4747
;;
4848
pypy)
49-
pyenv install "pypy-${PYPY_VERSION}"
50-
pyenv global "pypy-${PYPY_VERSION}"
49+
pyenv install "pypy${PYPY_VERSION}"
50+
pyenv global "pypy${PYPY_VERSION}"
5151
;;
5252
esac
5353
pyenv rehash
@@ -59,8 +59,8 @@ else
5959
export PYENV_ROOT="$PWD/.pyenv"
6060
export PATH="$PYENV_ROOT/bin:$PATH"
6161
eval "$(pyenv init -)"
62-
pyenv install "pypy-${PYPY_VERSION}"
63-
pyenv global "pypy-${PYPY_VERSION}"
62+
pyenv install "pypy${PYPY_VERSION}"
63+
pyenv global "pypy${PYPY_VERSION}"
6464
fi
6565
pip install -U virtualenv
6666
fi

.travis/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ else
1414
export PYENV_ROOT="$PWD/.pyenv"
1515
export PATH="$PYENV_ROOT/bin:$PATH"
1616
eval "$(pyenv init -)"
17-
pyenv global "pypy-${PYPY_VERSION}"
17+
pyenv global "pypy${PYPY_VERSION}"
1818
fi
1919
fi
2020
source $PWD/.venv/bin/activate

boxsdk/auth/developer_token_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def __init__(self, get_new_token_callback=None, **kwargs):
2222
def _refresh_developer_token(self):
2323
if self._get_new_token is not None:
2424
return self._get_new_token()
25-
else:
26-
return input(self.ENTER_TOKEN_PROMPT)
25+
26+
return input(self.ENTER_TOKEN_PROMPT)
2727

2828
def _refresh(self, access_token):
2929
"""

boxsdk/auth/jwt_auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,4 @@ def _refresh(self, access_token):
292292
# pylint:disable=unused-argument
293293
if self._user_id is None:
294294
return self.authenticate_instance()
295-
else:
296-
return self.authenticate_user()
295+
return self.authenticate_user()

boxsdk/auth/oauth2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ def refresh(self, access_token_to_refresh):
207207
# be refreshed, or if we don't currently have any active access
208208
# token, we make the request to refresh the token.
209209
return self._refresh(access_token_to_refresh)
210-
else:
211-
# If the active access token (self._access_token) is not the same as the token needs to be refreshed,
212-
# it means the expired token has already been refreshed. Simply return the current active tokens.
213-
return access_token, refresh_token
210+
211+
# If the active access token (self._access_token) is not the same as the token needs to be refreshed,
212+
# it means the expired token has already been refreshed. Simply return the current active tokens.
213+
return access_token, refresh_token
214214

215215
@staticmethod
216216
def _get_state_csrf_token():

boxsdk/object/base_api_json_object.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ def __repr__(self):
118118
description = '<Box {0}{1}>'.format(self.__class__.__name__, extra_description)
119119
if six.PY2:
120120
return description.encode('utf-8')
121-
else:
122-
return description
121+
return description
123122

124123
@property
125124
def _description(self):

boxsdk/object/base_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ def _description(self):
3434
"""Base class override. Return a description for the object."""
3535
if 'name' in self._response_object:
3636
return '{0} ({1})'.format(self._object_id, self.name) # pylint:disable=no-member
37-
else:
38-
return '{0}'.format(self._object_id)
37+
return '{0}'.format(self._object_id)
3938

4039
def get_url(self, *args):
4140
"""
4241
Base class override.
4342
Return the given object's URL, appending any optional parts as specified by args.
4443
"""
44+
# pylint:disable=arguments-differ
4545
return super(BaseObject, self).get_url('{0}s'.format(self._item_type), self._object_id, *args)
4646

4747
def get_type_url(self):

boxsdk/object/collaboration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Collaboration(BaseObject):
3232
"""An object that represents a collaboration between a folder and an individual or group"""
3333
_item_type = 'collaboration'
3434

35-
# pylint:disable=arguments-differ
3635
@api_call
3736
def update_info(self, role=None, status=None):
3837
"""Edit an existing collaboration on Box
@@ -53,6 +52,7 @@ def update_info(self, role=None, status=None):
5352
:raises:
5453
:class:`BoxAPIException` if current user doesn't have permissions to edit the collaboration.
5554
"""
55+
# pylint:disable=arguments-differ
5656
data = {}
5757
if role:
5858
data['role'] = role

boxsdk/object/events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Events(BaseEndpoint):
5555

5656
def get_url(self, *args):
5757
"""Base class override."""
58+
# pylint:disable=arguments-differ
5859
return super(Events, self).get_url('events', *args)
5960

6061
@api_call

0 commit comments

Comments
 (0)