StackStorm-Exchange / stackstorm-kafka

Integration pack for Apache Kafka message broker
https://exchange.stackstorm.org/
Apache License 2.0
5 stars 11 forks source link

stackstorm-kafka pack broken in stackstorm 3.7.0 #15

Closed alexandrejuma closed 10 months ago

alexandrejuma commented 2 years ago

It seems that the pack is not compatible with python 3.8 used in stackstorm 3.7.0.

It uses a dependency kafka-python>=0.9.4,<1.0 which is not compatible with python 3.8 (uses a newly reserved keyword: async).

Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py", line 264, in _get_action_instance
    actions_cls = action_loader.register_plugin(Action, self._file_path)
  File "/opt/stackstorm/st2/lib/python3.8/site-packages/st2common/util/loader.py", line 173, in register_plugin
    module = imp.load_source(module_name, plugin_abs_file_path)
  File "/usr/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/stackstorm/packs/kafka/actions/produce.py", line 2, in <module>
    from kafka import SimpleProducer, KafkaClient
  File "/opt/stackstorm/virtualenvs/kafka/lib/python3.8/site-packages/kafka/__init__.py", line 12, in <module>
    from kafka.producer import SimpleProducer, KeyedProducer
  File "/opt/stackstorm/virtualenvs/kafka/lib/python3.8/site-packages/kafka/producer/__init__.py", line 1, in <module>
    from .simple import SimpleProducer
  File "/opt/stackstorm/virtualenvs/kafka/lib/python3.8/site-packages/kafka/producer/simple.py", line 58
    return '<SimpleProducer batch=%s>' % self.async
                                              ^
SyntaxError: invalid syntax