Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from level12/17-optional-keg-dependency
Make keg/keg-elements optional dependencies
- Loading branch information
Showing
6 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from keg_storage.plugin import Storage # noqa | ||
from importlib.util import find_spec as _find_spec | ||
|
||
if _find_spec('keg'): | ||
from keg_storage.plugin import Storage # noqa | ||
from keg_storage.backends import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
from importlib.util import find_spec | ||
|
||
from .base import StorageBackend, FileNotFoundInStorageError, FileMode # noqa | ||
from .s3 import S3Storage # noqa | ||
from .sftp import SFTPStorage # noqa | ||
from .azure import AzureStorage # noqa | ||
|
||
__all__ = [ | ||
'StorageBackend', | ||
'FileNotFoundInStorageError', | ||
'FileMode', | ||
'base', | ||
] | ||
|
||
if find_spec('boto3') is not None: | ||
from .s3 import S3Storage # noqa | ||
__all__.extend(['s3', 'S3Storage']) | ||
|
||
if find_spec('paramiko') is not None: | ||
from .sftp import SFTPStorage # noqa | ||
__all__.extend(['sftp', 'SFTPStorage']) | ||
|
||
if find_spec('azure') is not None: | ||
from .azure import AzureStorage # noqa | ||
__all__.extend(['azure', 'AzureStorage']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters