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

Support Azure Storage Blob #444

Merged
merged 29 commits into from
May 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ee15176
feat(test): mock azure storage blob classes + unit test them
Mar 24, 2020
9ff2246
feat(azure storage blob): add asb file + update tests
Mar 25, 2020
b2f5550
feat(travis): remove duplicated line
Mar 25, 2020
2e14124
feat(asb): update tests + implem open function
Mar 26, 2020
51c85f1
Merge branch 'master' into master
nclsmitchell Mar 26, 2020
13ab9e8
feat(tests): add unittests for reading and wrinting class
Apr 1, 2020
4cab5f0
Merge branch 'master' of github.com:nclsmitchell/smart_open
Apr 1, 2020
af91f7f
feat(tests): fix gzip test
Apr 2, 2020
bdce8ee
feat(review): update class names + fix typo
Apr 2, 2020
7fa289a
feat(copyright): update copyright year
Apr 6, 2020
a4a25ec
feat(import): use fully qualified name in source
Apr 6, 2020
95a69fc
feat(merge): merge from upstream/master
Apr 6, 2020
a919326
feat(asb): remove six import
Apr 6, 2020
ab369d0
feat(reader): add __enter__ and __exit__ functions
Apr 6, 2020
0168fac
feat(import): add try/except on Azure dependencies
Apr 6, 2020
3e50041
feat(write): handle multiple writings on single files
Apr 8, 2020
ab73774
feat(feedback): handle PR feedbacks
Apr 8, 2020
559a149
feat(merge): merge from master
Apr 8, 2020
f5e965d
feat(feedback): handle PR feedbacks
Apr 8, 2020
09d234b
feat(feedback): handle PR feedbacks
Apr 8, 2020
98dddfb
feat(feedbacks): handle PR feedbacks
Apr 11, 2020
14212f7
feat(feedbacks): handle PR feedbacks
Apr 11, 2020
34c9228
feat(flake8): fix linter requirements + asb requitements in setup.py
Apr 21, 2020
d9d504c
feat(flake8): fix linter requirements + handle python 3.5 syntax
Apr 21, 2020
1f02e30
feat(feedbacks): update string formatting
Apr 21, 2020
34a29fe
feat(coverage): enhance code coverage
Apr 21, 2020
4262312
feat(coverage): enhance code coverage
Apr 21, 2020
4a09f5f
feat(coverage): enhance code coverage
Apr 21, 2020
a2bed0e
feat(flake8): fix linter requirements
Apr 21, 2020
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: 6 additions & 3 deletions smart_open/asb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
import io
import logging

import azure.storage.blob
import azure.core.exceptions

import smart_open.bytebuffer
import smart_open.constants

logger = logging.getLogger(__name__)

try:
nclsmitchell marked this conversation as resolved.
Show resolved Hide resolved
import azure.storage.blob
import azure.core.exceptions
except ImportError:
logger.info('Azure dependencies are not installed')

_BINARY_TYPES = (bytes, bytearray, memoryview)
"""Allowed binary buffer types for writing to the underlying Azure Storage Blob stream"""

Expand Down
14 changes: 9 additions & 5 deletions smart_open/tests/test_asb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@
import mock
from collections import OrderedDict

import azure.storage.blob
import azure.common
import azure.core.exceptions

import smart_open
import smart_open.constants

logger = logging.getLogger(__name__)

try:
nclsmitchell marked this conversation as resolved.
Show resolved Hide resolved
import azure.storage.blob
import azure.common
import azure.core.exceptions
except ImportError:
logger.info('Azure dependencies are not installed')

CONTAINER_NAME = 'test-smartopen-{}'.format(uuid.uuid4().hex)
BLOB_NAME = 'test-blob'
DISABLE_MOCKS = os.environ.get('SO_DISABLE_Azure Storage Blob_MOCKS') == "1"
nclsmitchell marked this conversation as resolved.
Show resolved Hide resolved

logger = logging.getLogger(__name__)


class FakeBlobClient(object):
Expand Down