Skip to content

Commit 6228917

Browse files
examples fixes
1 parent a3f1cff commit 6228917

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.vscode/launch.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "kafka-python: Apache",
66
"type": "debugpy",
77
"request": "launch",
8-
"program": "${workspaceFolder}/examples/kafkapy/apache.py",
8+
"module": "examples.kafkapy.apache",
99
"console": "integratedTerminal",
1010
"env": {
1111
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -18,7 +18,7 @@
1818
"name": "kafka-python: Aiven",
1919
"type": "debugpy",
2020
"request": "launch",
21-
"program": "${workspaceFolder}/examples/kafkapy/aiven.py",
21+
"module": "examples.kafkapy.aiven",
2222
"console": "integratedTerminal",
2323
"env": {
2424
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -31,7 +31,7 @@
3131
"name": "kafka-python: Confluent",
3232
"type": "debugpy",
3333
"request": "launch",
34-
"program": "${workspaceFolder}/examples/kafkapy/confluent.py",
34+
"module": "examples.kafkapy.confluent",
3535
"console": "integratedTerminal",
3636
"env": {
3737
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -44,7 +44,7 @@
4444
"name": "kafka-python: MSK",
4545
"type": "debugpy",
4646
"request": "launch",
47-
"program": "${workspaceFolder}/examples/kafkapy/msk.py",
47+
"module": "examples.kafkapy.msk",
4848
"console": "integratedTerminal",
4949
"env": {
5050
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -57,7 +57,7 @@
5757
"name": "aiokafka: Apache",
5858
"type": "debugpy",
5959
"request": "launch",
60-
"program": "${workspaceFolder}/examples/aiokafka/apache.py",
60+
"module": "examples.aiokafka.apache",
6161
"console": "integratedTerminal",
6262
"env": {
6363
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -70,7 +70,7 @@
7070
"name": "aiokafka: Aiven",
7171
"type": "debugpy",
7272
"request": "launch",
73-
"program": "${workspaceFolder}/examples/aiokafka/aiven.py",
73+
"module": "examples.aiokafka.aiven",
7474
"console": "integratedTerminal",
7575
"env": {
7676
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -83,7 +83,7 @@
8383
"name": "aiokafka: Confluent",
8484
"type": "debugpy",
8585
"request": "launch",
86-
"program": "${workspaceFolder}/examples/aiokafka/confluent.py",
86+
"module": "examples.aiokafka.confluent",
8787
"console": "integratedTerminal",
8888
"env": {
8989
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -96,7 +96,7 @@
9696
"name": "aiokafka: MSK",
9797
"type": "debugpy",
9898
"request": "launch",
99-
"program": "${workspaceFolder}/examples/aiokafka/msk.py",
99+
"module": "examples.aiokafka.msk",
100100
"console": "integratedTerminal",
101101
"env": {
102102
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -109,7 +109,7 @@
109109
"name": "confluent-kafka: Apache",
110110
"type": "debugpy",
111111
"request": "launch",
112-
"program": "${workspaceFolder}/examples/confluent_kafka/apache.py",
112+
"module": "examples.confluent_kafka.apache",
113113
"console": "integratedTerminal",
114114
"env": {
115115
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -122,7 +122,7 @@
122122
"name": "confluent-kafka: Aiven",
123123
"type": "debugpy",
124124
"request": "launch",
125-
"program": "${workspaceFolder}/examples/confluent_kafka/aiven.py",
125+
"module": "examples.confluent_kafka.aiven",
126126
"console": "integratedTerminal",
127127
"env": {
128128
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -135,7 +135,7 @@
135135
"name": "confluent-kafka: Confluent",
136136
"type": "debugpy",
137137
"request": "launch",
138-
"program": "${workspaceFolder}/examples/confluent_kafka/confluent.py",
138+
"module": "examples.confluent_kafka.confluent",
139139
"console": "integratedTerminal",
140140
"env": {
141141
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",
@@ -148,7 +148,7 @@
148148
"name": "confluent-kafka: MSK",
149149
"type": "debugpy",
150150
"request": "launch",
151-
"program": "${workspaceFolder}/examples/confluent_kafka/msk.py",
151+
"module": "examples.confluent_kafka.msk",
152152
"console": "integratedTerminal",
153153
"env": {
154154
"SUPERSTREAM_TOPICS_LIST": "test-topic,test-topic-1,test-topic-2,test-topic-3",

examples/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Examples package
2+
3+
import importlib, sys
4+
# Expose json_generator as a top-level module name so example scripts can simply `import json_generator`
5+
if 'json_generator' not in sys.modules:
6+
sys.modules['json_generator'] = importlib.import_module(__name__ + '.json_generator')

0 commit comments

Comments
 (0)