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

botocore not included in dependencies for PyPi package #174

Closed
here-abarany opened this issue Mar 26, 2024 · 2 comments · Fixed by #175
Closed

botocore not included in dependencies for PyPi package #174

here-abarany opened this issue Mar 26, 2024 · 2 comments · Fixed by #175
Assignees
Labels
bug Something isn't working

Comments

@here-abarany
Copy link

As of version 2.1.0 a botocore dependency has been added, and is listed in requirements-dev.txt, but isn't included for the PyPi package built by setup.py. As a result you will get an ImportError when trying to use the package if you haven't manually installed the dependency.

It would be nice if the SASL component would be automatically disabled if botocore isn't present so all clients don't require the extra dependency if that feature isn't needed.

For reference, here's the import stack that leads to the error.

  File "C:\...\venv\Lib\site-packages\kafka\__init__.py", line 19, in <module>
    from kafka.admin import KafkaAdminClient
  File "C:\...\venv\Lib\site-packages\kafka\admin\__init__.py", line 2, in <module>
    from kafka.admin.client import KafkaAdminClient
  File "C:\...\venv\Lib\site-packages\kafka\admin\client.py", line 10, in <module>
    from kafka.client_async import KafkaClient, selectors
  File "C:\...\venv\Lib\site-packages\kafka\client_async.py", line 11, in <module>
    from kafka.cluster import ClusterMetadata
  File "C:\...\venv\Lib\site-packages\kafka\cluster.py", line 8, in <module>
    from kafka.conn import collect_hosts
  File "C:\...\venv\Lib\site-packages\kafka\conn.py", line 11, in <module>
  File "C:\...\venv\Lib\site-packages\kafka\sasl\__init__.py", line 3, in <module>
    from kafka.sasl import gssapi, oauthbearer, plain, scram, msk
  File "C:\...\venv\Lib\site-packages\kafka\sasl\msk.py", line 13, in <module>
    from botocore.session import Session as BotoSession  # importing it in advance is not an option apparently...
@wbarnha wbarnha self-assigned this Mar 27, 2024
@wbarnha
Copy link
Owner

wbarnha commented Mar 27, 2024

My apologies! Let me fix the imports so that it's not required to be installed.

@wbarnha wbarnha added the bug Something isn't working label Mar 27, 2024
@here-abarany
Copy link
Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants