Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kstreams/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import ssl
import sys
from tempfile import NamedTemporaryFile
from typing import Any, Optional, Type, Union
from typing import Optional, Type, Union

from aiokafka.helpers import create_ssl_context as aiokafka_create_ssl_context

Expand Down Expand Up @@ -75,13 +75,16 @@ def create_ssl_context(
certfile: Optional[str] = None,
keyfile: Optional[str] = None,
password: Optional[str] = None,
crlfile: Any = None,
):
"""Wrapper of [aiokafka.helpers.create_ssl_context](
https://aiokafka.readthedocs.io/en/stable/api.html#helpers
)
with typehints.

Note:
Legacy function, we leave it to not depend directly on aiokafka,
but aiokafka now has typehints.

Arguments:
cafile: Certificate Authority file path containing certificates
used to sign broker certificates
Expand All @@ -104,7 +107,6 @@ def create_ssl_context(
certfile=certfile,
keyfile=keyfile,
password=password,
crlfile=crlfile,
)


Expand Down
2 changes: 1 addition & 1 deletion scripts/bench-compare
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script runs pytest benchmarks to compare benchmark results.
#
# The script compares the latest benchmark with the current code.
Expand Down
3 changes: 2 additions & 1 deletion scripts/bench-current
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash
# This script runs benchmark tests using pytest and saves the results.
#
# By saving this information, way we can keep track of the regressions in performance.
Expand All @@ -7,6 +7,7 @@
# Usage:
# 1. Run this script from the terminal: ./bench-current
# 2. The benchmark results will be saved in the `.benchmarks` folder.
set -e

export PREFIX=""
if [ -d '.venv' ] ; then
Expand Down
3 changes: 2 additions & 1 deletion scripts/cluster/bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
#!/usr/bin/env sh
set -e

service="${1:-kafka}"
docker-compose run --user="$(id -u)" "${service}" bash
3 changes: 2 additions & 1 deletion scripts/cluster/events/read
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh -e
#!/usr/bin/env sh
#
# Read messages from the given kafka topic
#
# Usage:
#
# ./scripts/cluster/events/read # default: local--hello-world
# ./scripts/cluster/events/read "example-topic"
set -e

topic_name="${1:-local--hello-world}"

Expand Down
3 changes: 2 additions & 1 deletion scripts/cluster/events/send
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh -e
#!/usr/bin/env sh
#
# Send messages to the given kafka topic (default: local--hello-world)
#
# Usage:
#
# ./scripts/cluster/events/send # default: local--hello-world
# ./scripts/cluster/events/send example-topic
set -e

topic_name="${1:-local--hello-world}"

Expand Down
3 changes: 2 additions & 1 deletion scripts/cluster/logs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh -e
#!/usr/bin/env sh
set -e

docker-compose logs -f
3 changes: 2 additions & 1 deletion scripts/cluster/restart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
#!/usr/bin/env sh
set -e

service="${1:-kafka}"
docker-compose restart "${service}"
3 changes: 2 additions & 1 deletion scripts/cluster/start
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
#!/usr/bin/env sh
set -e

docker-compose up -d
scripts/cluster/topics/create "local--kstreams"
Expand Down
3 changes: 2 additions & 1 deletion scripts/cluster/stop
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh -e
#!/usr/bin/env sh
set -e

docker-compose stop
docker-compose rm --force -v
3 changes: 2 additions & 1 deletion scripts/cluster/topics/create
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh -e
#!/usr/bin/env sh
#
# Create a new kafka topic
#
# Usage:
# ./scripts/cluster/topics/create "example-topic"
# ./scripts/cluster/topics/create "example-topic" partitions=3
#
set -e

topic_name=$1
partitions=${2:-1}
Expand Down
3 changes: 2 additions & 1 deletion scripts/cluster/topics/ls
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh -e
#!/usr/bin/env sh
#
# List available topics
#
# Usage:
# ./scripts/cluster/topics/ls
#
set -e

docker-compose exec kafka kafka-topics --list --bootstrap-server kafka:9092
3 changes: 2 additions & 1 deletion scripts/format
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

export PREFIX=""
if [ -d '.venv' ] ; then
Expand Down
7 changes: 4 additions & 3 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

PYTHON="${PYTHON:=python3.10}"
POETRY_VERSION="${POETRY_VERSION:=1.1.4}"
PYTHON="${PYTHON:=python3.10}"
POETRY_VERSION="${POETRY_VERSION:=1.1.4}"
PREFIX=".venv/bin/"

$PYTHON -m venv .venv --clear
Expand Down
3 changes: 2 additions & 1 deletion scripts/publish
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

export PREFIX=""
if [ -d '.venv' ] ; then
Expand Down
3 changes: 2 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

export PREFIX=""
if [ -d '.venv' ] ; then
Expand Down
Loading