Skip to content

Commit

Permalink
Do not touch botocore unless it is installed (#803)
Browse files Browse the repository at this point in the history
* Proper S3 exception on MISSING_DEPS

* Fix check for MISSING_DEPS

* Add test
  • Loading branch information
ddelange committed Feb 26, 2024
1 parent 0ce08af commit d23ec41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ jobs:
- name: Upgrade PyOpenSSL
run: python -m pip install pyOpenSSL --upgrade

- name: Install smart_open without dependencies
run: pip install -e .

- name: Check that smart_open imports without dependencies
run: python -c 'import smart_open'

- name: Install smart_open and its dependencies
run: pip install -e .[test]

Expand Down
3 changes: 2 additions & 1 deletion smart_open/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def _do(self, fn: Callable):
# The retry mechanism for this submodule. Client code may modify it, e.g. by
# updating RETRY.sleep_seconds and friends.
#
RETRY = Retry()
if 'MISSING_DEPS' not in locals():
RETRY = Retry()


class _ClientWrapper:
Expand Down

0 comments on commit d23ec41

Please sign in to comment.