diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..5f4c751baf --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + "service": "python-3.12-faststream-studio", + "dockerComposeFile": [ + "./docker-compose.yaml" + ], + "shutdownAction": "stopCompose", + "forwardPorts": [ + "kafka-faststream:9092" + ], + "updateContentCommand": "bash .devcontainer/setup.sh", + "workspaceFolder": "/workspaces/faststream" + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml new file mode 100644 index 0000000000..01c4a56fb4 --- /dev/null +++ b/.devcontainer/docker-compose.yaml @@ -0,0 +1,33 @@ +version: '3' + +services: + python-3.12-faststream-studio: + image: mcr.microsoft.com/devcontainers/python:3.12 + container_name: python-3.12-faststream-studio + volumes: + - ../:/workspaces/faststream:cached + command: sleep infinity + network_mode: "host" + + kafka-faststream: + image: bitnami/kafka:3.5.0 + container_name: kafka-faststream + ports: + - 9092:9092 + environment: + KAFKA_ENABLE_KRAFT: "true" + KAFKA_CFG_NODE_ID: "1" + KAFKA_CFG_PROCESS_ROLES: "broker,controller" + KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER" + KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093" + KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT" + KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://127.0.0.1:9092" + KAFKA_BROKER_ID: "1" + KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "1@kafka-faststream:9093" + ALLOW_PLAINTEXT_LISTENER: "true" + networks: + - faststream-network + +networks: + faststream-network: + name: "${USER}-faststream-network" \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000000..fb0b3f4fc4 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,7 @@ +pip install uv + +uv venv .venv + +uv pip install -e ".[dev]" + +source .venv/bin/activate \ No newline at end of file diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml deleted file mode 100644 index a72abdca78..0000000000 --- a/.github/dependabot.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - # GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - # Python - - package-ecosystem: "pip" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..b1cf7f5185 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/serve.py b/serve.py new file mode 100644 index 0000000000..2de789b4cd --- /dev/null +++ b/serve.py @@ -0,0 +1,5 @@ +from faststream import FastStream +from faststream.kafka import KafkaBroker + +broker = KafkaBroker() +app = FastStream(broker) \ No newline at end of file diff --git a/tests/brokers/confluent/test_test_reentrancy.py b/tests/brokers/confluent/test_test_reentrancy.py index fde984ec57..5b10b4c593 100644 --- a/tests/brokers/confluent/test_test_reentrancy.py +++ b/tests/brokers/confluent/test_test_reentrancy.py @@ -51,7 +51,7 @@ async def on_output_data(msg: int): async with TestKafkaBroker(broker) as tester: await tester.publish(1, "input_data") - await on_output_data.wait_call(3) + await on_output_data.wait_call(10) on_input_data.mock.assert_called_with(1) to_output_data.mock.assert_called_with(2) diff --git a/tests/docs/getting_started/publishing/test_broker_context.py b/tests/docs/getting_started/publishing/test_broker_context.py index aa8d0f194b..7d5e5ff749 100644 --- a/tests/docs/getting_started/publishing/test_broker_context.py +++ b/tests/docs/getting_started/publishing/test_broker_context.py @@ -38,7 +38,7 @@ async def test_broker_context_confluent(): from faststream.confluent import TestKafkaBroker as TestConfluentKafkaBroker async with TestConfluentKafkaBroker(broker, with_real=True), TestApp(app): - await handle.wait_call(5) + await handle.wait_call(10) handle.mock.assert_called_once_with("Hi!")