Skip to content

Commit

Permalink
requests_aws4auth optional lib added.
Browse files Browse the repository at this point in the history
  • Loading branch information
YukSeungChan committed Dec 7, 2016
1 parent 52a890a commit 7190e3b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements-optional.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
python-magic >= 0.4.12
wand >= 0.4.3
requests-aws4auth >= 0.9
19 changes: 19 additions & 0 deletions sqlalchemy_media/optionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,22 @@ def ensure_wand():

if wand is None: # pragma: no cover
raise OptionalPackageRequirementError('wand')


# requests-aws4auth
try:
# noinspection PyPackageRequirements
from requests_aws4auth import AWS4Auth
except ImportError: # pragma: no cover
AWS4Auth = None


def ensure_aws4auth():
"""
.. warning:: :exc:`.OptionalPackageRequirementError` will be raised if ``requests-aws4auth`` is not installed.
"""

if AWS4Auth is None: # pragma: no cover
raise OptionalPackageRequirementError('requests-aws4auth')

0 comments on commit 7190e3b

Please sign in to comment.