Thanks to visit codestin.com
Credit goes to github.com

Skip to content

botocore not included in dependencies for PyPi package #174

Closed
@here-abarany

Description

@here-abarany

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...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions