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

updating dxpy3 to dxpy #111

Merged
merged 3 commits into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

v3.0.5
------
* Changed dxpy3 requirement to dxpy to reflect Python3 updates to dxpy

v3.0.4
------
* Fix release notes.
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ requests!=2.12.2,!=2.13.0,>=2.10.0
boto3>=1.4.0
cached-property
contextlib2
dxpy>=0.265.0; python_version <= '2.7'
dxpy3; python_version > '3.0'
dxpy>=0.278.0
python-keystoneclient>=1.8.1
python-swiftclient
six>=1.9.0
7 changes: 3 additions & 4 deletions stor/dx.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,7 @@ def upload(self, to_upload, **kwargs):

def read_object(self):
"""Reads an individual object from DX.

Note dxpy3 automatically decodes the DXFile.read using
Note dxpy for Py3 automatically decodes the DXFile.read using utf-8.

Returns:
bytes: the raw bytes from the object on DX.
Expand All @@ -815,8 +814,8 @@ def read_object(self):
with _wrap_dx_calls():
result = file_handler.read()
if six.PY3: # pragma: no cover
# TODO (akumar): allow other encoding after update of dxpy3
result = result.encode('utf-8') # dxpy3 already decodes the data with 'utf-8'
# TODO (akumar): allow other encoding after update of encoding in dxpy for Py3
result = result.encode('utf-8') # dxpy for py3 already decodes the data with 'utf-8'
return result

def write_object(self, content, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions stor/tests/test_integration_dx.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_read_string_from_text(self):

def test_custom_encoding_text(self):
# explicit encoding is only supported for py3 in general
# dxpy3 assumes the encoding is utf-8. can't support other encoding for dx
# dxpy py3 assumes the encoding is utf-8. can't support other encoding for dx
pass

def test_over_100_files(self):
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_upload_download_remove(self):
time.sleep(.5)
self.assertFalse((self.test_dir / which_obj).exists())

@skipIf(six.PY3, 'dxpy3 assumes utf-8 encoding, not suitable for gzip')
@skipIf(six.PY3, 'dxpy py3 assumes utf-8 encoding, not suitable for gzip')
def test_gzip_on_remote(self):
self._skip_if_filesystem_python3(self.test_dir)
local_gzip = os.path.join(os.path.dirname(__file__),
Expand Down