asyncapi-python 0.2.4__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asyncapi_python-0.3.0/.asyncapi-tool +12 -0
- asyncapi_python-0.3.0/.devcontainer/Dockerfile +43 -0
- asyncapi_python-0.3.0/.devcontainer/devcontainer.json +73 -0
- asyncapi_python-0.3.0/.devcontainer/docker-compose.yml +17 -0
- asyncapi_python-0.3.0/.github/workflows/release.yml +90 -0
- asyncapi_python-0.3.0/.github/workflows/test.yml +98 -0
- asyncapi_python-0.3.0/.gitignore +431 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/PKG-INFO +23 -65
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/README.md +9 -44
- asyncapi_python-0.3.0/examples/amqp-pub-sub/.gitignore +6 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/Makefile +27 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/README.md +42 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/main-publisher.py +24 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/main-subscriber.py +39 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/spec/common.asyncapi.yaml +19 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/spec/publisher.asyncapi.yaml +9 -0
- asyncapi_python-0.3.0/examples/amqp-pub-sub/spec/subscriber.asyncapi.yaml +9 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/.gitignore +6 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/Makefile +27 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/README.md +42 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/main-client.py +25 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/main-server.py +42 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/spec/client.asyncapi.yaml +11 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/spec/common.asyncapi.yaml +35 -0
- asyncapi_python-0.3.0/examples/amqp-rpc/spec/server.asyncapi.yaml +11 -0
- asyncapi_python-0.3.0/examples/amqp-topic/.gitignore +7 -0
- asyncapi_python-0.3.0/examples/amqp-topic/Makefile +64 -0
- asyncapi_python-0.3.0/examples/amqp-topic/README.md +133 -0
- asyncapi_python-0.3.0/examples/amqp-topic/main-publisher.py +106 -0
- asyncapi_python-0.3.0/examples/amqp-topic/main-subscriber1.py +89 -0
- asyncapi_python-0.3.0/examples/amqp-topic/main-subscriber2.py +89 -0
- asyncapi_python-0.3.0/examples/amqp-topic/spec/common.asyncapi.yaml +81 -0
- asyncapi_python-0.3.0/examples/amqp-topic/spec/publisher.asyncapi.yaml +25 -0
- asyncapi_python-0.3.0/examples/amqp-topic/spec/subscriber1.asyncapi.yaml +24 -0
- asyncapi_python-0.3.0/examples/amqp-topic/spec/subscriber2.asyncapi.yaml +24 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/.gitignore +6 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/Makefile +36 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/README.md +76 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/main-producer.py +46 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/main-worker.py +49 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/spec/common.asyncapi.yaml +37 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/spec/producer.asyncapi.yaml +12 -0
- asyncapi_python-0.3.0/examples/amqp-work-queue/spec/worker.asyncapi.yaml +12 -0
- asyncapi_python-0.3.0/examples/specs/financial-trading-system.yaml +1367 -0
- asyncapi_python-0.3.0/flake.lock +61 -0
- asyncapi_python-0.3.0/flake.nix +47 -0
- asyncapi_python-0.3.0/pyproject.toml +62 -0
- asyncapi_python-0.3.0/src/asyncapi_python/__init__.py +11 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/__init__.py +3 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/codec/__init__.py +5 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/codec/json.py +181 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/codec/registry.py +97 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/__init__.py +5 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/__init__.py +5 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/config.py +52 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/consumer.py +224 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/factory.py +195 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/message.py +59 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/producer.py +163 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/resolver.py +411 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/amqp/utils.py +45 -0
- asyncapi_python-0.3.0/src/asyncapi_python/contrib/wire/in_memory.py +253 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/application.py +110 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/codec.py +50 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/__init__.py +54 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/bindings.py +185 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/channel.py +51 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/common.py +22 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/message.py +84 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/document/operation.py +96 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/__init__.py +36 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/abc/__init__.py +16 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/abc/base.py +170 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/abc/interfaces.py +57 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/abc/params.py +22 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/exceptions.py +19 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/message.py +28 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/publisher.py +77 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/rpc_client.py +158 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/rpc_reply_handler.py +187 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/rpc_server.py +473 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/endpoint/subscriber.py +340 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/exceptions.py +19 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/typing.py +143 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/wire/__init__.py +28 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/wire/typing.py +28 -0
- asyncapi_python-0.3.0/src/asyncapi_python/kernel/wire/utils.py +61 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/__init__.py +14 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/cli.py +83 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/__init__.py +5 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/main.py +135 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/messages.py +305 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/parameters.py +193 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/routers.py +356 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/generators/templates.py +170 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/__init__.py +6 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/context.py +64 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/document_loader.py +119 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/extractors.py +478 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/references.py +125 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/parser/types.py +92 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/__init__.py.j2 +12 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/application.py.j2 +76 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/messages.py.j2 +24 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/messages_datamodel.py.j2 +1 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/messages_init.py.j2 +1 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/parameters.py.j2 +1 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/templates/router.py.j2 +88 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/__init__.py +75 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/base.py +122 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/context.py +36 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/core/__init__.py +501 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/errors.py +66 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/protocol/__init__.py +6 -0
- asyncapi_python-0.3.0/src/asyncapi_python_codegen/validation/protocol/amqp.py +64 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python_pants/rules.py +18 -16
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python_pants/targets.py +8 -8
- asyncapi_python-0.3.0/tests/__init__.py +1 -0
- asyncapi_python-0.3.0/tests/codegen/__init__.py +1 -0
- asyncapi_python-0.3.0/tests/codegen/specs/deep_recursion/level1.yaml +24 -0
- asyncapi_python-0.3.0/tests/codegen/specs/deep_recursion/level2.yaml +22 -0
- asyncapi_python-0.3.0/tests/codegen/specs/deep_recursion/level3.yaml +28 -0
- asyncapi_python-0.3.0/tests/codegen/specs/deep_recursion/level4.yaml +21 -0
- asyncapi_python-0.3.0/tests/codegen/specs/relative_refs/common/channels.yaml +22 -0
- asyncapi_python-0.3.0/tests/codegen/specs/relative_refs/main.yaml +34 -0
- asyncapi_python-0.3.0/tests/codegen/specs/relative_refs/shared/messages.yaml +69 -0
- asyncapi_python-0.3.0/tests/codegen/specs/relative_refs/shared/notifications.yaml +10 -0
- asyncapi_python-0.3.0/tests/codegen/specs/rpc.yaml +118 -0
- asyncapi_python-0.3.0/tests/codegen/specs/simple.yaml +53 -0
- asyncapi_python-0.3.0/tests/codegen/test_parser.py +308 -0
- asyncapi_python-0.3.0/tests/codegen/test_validation.py +651 -0
- asyncapi_python-0.3.0/tests/codegen/test_validation_system.py +466 -0
- asyncapi_python-0.3.0/tests/conftest.py +100 -0
- asyncapi_python-0.3.0/tests/core/codec/test_json_codec.py +232 -0
- asyncapi_python-0.3.0/tests/core/endpoint/test_parameterized_subscriptions.py +773 -0
- asyncapi_python-0.3.0/tests/core/wire/test_amqp_resolver.py +198 -0
- asyncapi_python-0.3.0/tests/core/wire/test_amqp_utils.py +233 -0
- asyncapi_python-0.3.0/tests/integration/__init__.py +1 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/__init__.py +19 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/batch_processing.py +388 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/error_handling.py +675 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/fan_in_logging.py +323 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/fan_out_broadcasting.py +409 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/malformed_messages.py +561 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/many_to_many_microservices.py +931 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/producer_consumer.py +371 -0
- asyncapi_python-0.3.0/tests/integration/scenarios/reply_channel.py +253 -0
- asyncapi_python-0.3.0/tests/integration/test_app/__init__.py +2 -0
- asyncapi_python-0.3.0/tests/integration/test_app/messages/__init__.py +2 -0
- asyncapi_python-0.3.0/tests/integration/test_app/messages/json.py +94 -0
- asyncapi_python-0.3.0/tests/integration/test_wire_codec_scenarios.py +61 -0
- asyncapi_python-0.3.0/tests/kernel/endpoint/test_batch_processing.py +572 -0
- asyncapi_python-0.3.0/tests/kernel/endpoint/test_exception_handling.py +441 -0
- asyncapi_python-0.3.0/tests/kernel/endpoint/test_handler_enforcement.py +394 -0
- asyncapi_python-0.3.0/tests/kernel/endpoint/test_rpc_endpoints.py +1099 -0
- asyncapi_python-0.3.0/uv.lock +1170 -0
- asyncapi_python-0.2.4/pyproject.toml +0 -60
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/__init__.py +0 -37
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/base_application.py +0 -169
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/connection.py +0 -42
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/endpoint/__init__.py +0 -30
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/endpoint/base.py +0 -136
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/endpoint/receiver.py +0 -144
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/endpoint/sender.py +0 -69
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/error.py +0 -42
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/operation.py +0 -64
- asyncapi_python-0.2.4/src/asyncapi_python/amqp/utils.py +0 -42
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/__init__.py +0 -53
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/__init__.py +0 -27
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/base.py +0 -16
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/bindings/__init__.py +0 -21
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/bindings/amqp.py +0 -46
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/components.py +0 -69
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/document.py +0 -56
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/document_context.py +0 -38
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/ref.py +0 -118
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/document/utils.py +0 -114
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/__init__.py +0 -16
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/amqp/__init__.py +0 -18
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/amqp/generate.py +0 -296
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/amqp/templates/__init__.py.j2 +0 -14
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/amqp/templates/application.py.j2 +0 -21
- asyncapi_python-0.2.4/src/asyncapi_python_codegen/generators/amqp/templates/routes.py.j2 +0 -66
- asyncapi_python-0.2.4/src/asyncapi_python_pants/py.typed +0 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/LICENSE +0 -0
- {asyncapi_python-0.2.4/src/asyncapi_python → asyncapi_python-0.3.0/src/asyncapi_python/kernel}/__init__.py +0 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python/py.typed +0 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python/utils.py +0 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python_pants/__init__.py +0 -0
- {asyncapi_python-0.2.4/src/asyncapi_python_codegen → asyncapi_python-0.3.0/src/asyncapi_python_pants}/py.typed +0 -0
- {asyncapi_python-0.2.4 → asyncapi_python-0.3.0}/src/asyncapi_python_pants/register.py +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: asyncapi-python
|
|
3
|
+
description: Easily generate type-safe and async Python applications from AsyncAPI 3 specifications.
|
|
4
|
+
links:
|
|
5
|
+
repoUrl: https://github.com/G-USI/asyncapi-python/
|
|
6
|
+
websiteUrl: https://pypi.org/project/asyncapi-python/
|
|
7
|
+
filters:
|
|
8
|
+
language: python
|
|
9
|
+
technology:
|
|
10
|
+
- amqp
|
|
11
|
+
categories:
|
|
12
|
+
- code-generator
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
FROM mcr.microsoft.com/devcontainers/base:jammy
|
|
2
|
+
# FROM mcr.microsoft.com/devcontainers/base:jammy
|
|
3
|
+
|
|
4
|
+
ARG DEBIAN_FRONTEND=noninteractive
|
|
5
|
+
ARG USER=vscode
|
|
6
|
+
|
|
7
|
+
RUN DEBIAN_FRONTEND=noninteractive \
|
|
8
|
+
&& apt-get update \
|
|
9
|
+
&& apt-get install -y build-essential --no-install-recommends make \
|
|
10
|
+
ca-certificates \
|
|
11
|
+
git \
|
|
12
|
+
libssl-dev \
|
|
13
|
+
zlib1g-dev \
|
|
14
|
+
libbz2-dev \
|
|
15
|
+
libreadline-dev \
|
|
16
|
+
libsqlite3-dev \
|
|
17
|
+
wget \
|
|
18
|
+
curl \
|
|
19
|
+
llvm \
|
|
20
|
+
libncurses5-dev \
|
|
21
|
+
xz-utils \
|
|
22
|
+
tk-dev \
|
|
23
|
+
libxml2-dev \
|
|
24
|
+
libxmlsec1-dev \
|
|
25
|
+
libffi-dev \
|
|
26
|
+
liblzma-dev
|
|
27
|
+
|
|
28
|
+
# Python and uv installation
|
|
29
|
+
USER $USER
|
|
30
|
+
ARG HOME="/home/$USER"
|
|
31
|
+
ARG PYTHON_VERSION=3.10
|
|
32
|
+
|
|
33
|
+
ENV PYENV_ROOT="${HOME}/.pyenv"
|
|
34
|
+
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
|
|
35
|
+
|
|
36
|
+
RUN echo "done 0" \
|
|
37
|
+
&& curl https://pyenv.run | bash \
|
|
38
|
+
&& echo "done 1" \
|
|
39
|
+
&& pyenv install ${PYTHON_VERSION} \
|
|
40
|
+
&& echo "done 2" \
|
|
41
|
+
&& pyenv global ${PYTHON_VERSION} \
|
|
42
|
+
&& echo "done 3" \
|
|
43
|
+
&& curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AsyncAPI-Python",
|
|
3
|
+
"dockerComposeFile": "docker-compose.yml",
|
|
4
|
+
"service": "devcontainer",
|
|
5
|
+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
|
6
|
+
"forwardPorts": [
|
|
7
|
+
"rabbitmq:15672"
|
|
8
|
+
],
|
|
9
|
+
"containerEnv": {
|
|
10
|
+
"AMQP_URI": "amqp://guest:guest@rabbitmq/",
|
|
11
|
+
"PYTEST_AMQP_URI": "amqp://guest:guest@rabbitmq/"
|
|
12
|
+
},
|
|
13
|
+
"customizations": {
|
|
14
|
+
"vscode": {
|
|
15
|
+
"extensions": [
|
|
16
|
+
"ms-python.python",
|
|
17
|
+
"ms-pyright.pyright",
|
|
18
|
+
"njpwerner.autodocstring",
|
|
19
|
+
"tamasfe.even-better-toml",
|
|
20
|
+
"ms-python.mypy-type-checker",
|
|
21
|
+
"ms-python.black-formatter",
|
|
22
|
+
"ms-python.isort",
|
|
23
|
+
"redhat.vscode-yaml",
|
|
24
|
+
"streetsidesoftware.code-spell-checker",
|
|
25
|
+
"asyncapi.asyncapi-preview",
|
|
26
|
+
"DavidAnson.vscode-markdownlint",
|
|
27
|
+
"github.vscode-github-actions"
|
|
28
|
+
],
|
|
29
|
+
"settings": {
|
|
30
|
+
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
|
|
31
|
+
"python.analysis.typeCheckingMode": "strict",
|
|
32
|
+
"python.analysis.autoImportCompletions": true,
|
|
33
|
+
"python.analysis.diagnosticMode": "workspace",
|
|
34
|
+
"python.analysis.autoSearchPaths": true,
|
|
35
|
+
"python.analysis.extraPaths": [
|
|
36
|
+
"./src"
|
|
37
|
+
],
|
|
38
|
+
"python.analysis.include": [
|
|
39
|
+
"src/**",
|
|
40
|
+
"*.py"
|
|
41
|
+
],
|
|
42
|
+
"python.analysis.stubPath": "./src",
|
|
43
|
+
"python.linting.enabled": true,
|
|
44
|
+
"python.linting.pylintEnabled": false,
|
|
45
|
+
"python.linting.mypyEnabled": false,
|
|
46
|
+
"yaml.schemas": {
|
|
47
|
+
"https://asyncapi.com/schema-store/3.0.0-without-$id.json": [
|
|
48
|
+
"file:///workspaces/asyncapi-python/examples/*.yaml"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"cSpell.ignoreWords": [
|
|
52
|
+
"asyncapi",
|
|
53
|
+
"codegen",
|
|
54
|
+
"devcontainer",
|
|
55
|
+
"pydantic",
|
|
56
|
+
"datamodel",
|
|
57
|
+
"amqp",
|
|
58
|
+
"venv",
|
|
59
|
+
"jsonschema",
|
|
60
|
+
"fanout",
|
|
61
|
+
"anypointmq",
|
|
62
|
+
"googlepubsub",
|
|
63
|
+
"ibmmq",
|
|
64
|
+
"mqtt"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"features": {
|
|
70
|
+
"ghcr.io/devcontainers/features/github-cli:1": {},
|
|
71
|
+
"ghcr.io/devcontainers/features/node:1": {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
services:
|
|
3
|
+
devcontainer:
|
|
4
|
+
build:
|
|
5
|
+
context: .
|
|
6
|
+
dockerfile: Dockerfile
|
|
7
|
+
volumes:
|
|
8
|
+
- ../..:/workspaces:cached
|
|
9
|
+
command: sleep infinity
|
|
10
|
+
|
|
11
|
+
rabbitmq:
|
|
12
|
+
image: rabbitmq:3.13.6-management-alpine
|
|
13
|
+
volumes:
|
|
14
|
+
- rabbitmq_data:/var/lib/rabbitmq
|
|
15
|
+
|
|
16
|
+
volumes:
|
|
17
|
+
rabbitmq_data:
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: write
|
|
5
|
+
id-token: write
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags:
|
|
10
|
+
- "v*.*.*"
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
uses: ./.github/workflows/test.yml
|
|
15
|
+
|
|
16
|
+
build:
|
|
17
|
+
needs: test
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment:
|
|
20
|
+
name: pypi
|
|
21
|
+
url: https://pypi.org/p/asyncapi-python
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.10"
|
|
30
|
+
|
|
31
|
+
- name: Install UV
|
|
32
|
+
uses: astral-sh/setup-uv@v3
|
|
33
|
+
with:
|
|
34
|
+
enable-cache: true
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: uv sync
|
|
38
|
+
|
|
39
|
+
- name: Version Check and population of PROJECT_VERSION var
|
|
40
|
+
run: |
|
|
41
|
+
PROJECT_VERSION=$(uv run python -c "import importlib.metadata; print(importlib.metadata.version('asyncapi-python'))")
|
|
42
|
+
TAG=$(git describe HEAD --tags --abbrev=0)
|
|
43
|
+
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
|
|
44
|
+
echo "Project version: $PROJECT_VERSION"
|
|
45
|
+
echo "Git tag: $TAG"
|
|
46
|
+
if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then
|
|
47
|
+
echo "Version mismatch: Tag '$TAG' does not match project version 'v$PROJECT_VERSION'"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: Create Release
|
|
52
|
+
id: create_release
|
|
53
|
+
uses: actions/create-release@v1
|
|
54
|
+
env:
|
|
55
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
56
|
+
with:
|
|
57
|
+
tag_name: ${{ github.ref }}
|
|
58
|
+
release_name: ${{ github.ref }}
|
|
59
|
+
draft: true
|
|
60
|
+
prerelease: ${{ contains(github.ref, 'rc') }}
|
|
61
|
+
|
|
62
|
+
- name: Build sdist and wheel
|
|
63
|
+
run: |
|
|
64
|
+
mkdir -p dist
|
|
65
|
+
uv build
|
|
66
|
+
|
|
67
|
+
- name: Upload wheel to Release
|
|
68
|
+
uses: actions/upload-release-asset@v1
|
|
69
|
+
env:
|
|
70
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
71
|
+
with:
|
|
72
|
+
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
73
|
+
asset_path: ./dist/asyncapi_python-${{ env.PROJECT_VERSION }}-py3-none-any.whl
|
|
74
|
+
asset_name: asyncapi_python-${{ env.PROJECT_VERSION }}-py3-none-any.whl
|
|
75
|
+
asset_content_type: application/x-wheel+zip
|
|
76
|
+
|
|
77
|
+
- name: Upload sdist to Release
|
|
78
|
+
uses: actions/upload-release-asset@v1
|
|
79
|
+
env:
|
|
80
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
81
|
+
with:
|
|
82
|
+
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
83
|
+
asset_path: ./dist/asyncapi_python-${{ env.PROJECT_VERSION }}.tar.gz
|
|
84
|
+
asset_name: asyncapi_python-${{ env.PROJECT_VERSION }}.tar.gz
|
|
85
|
+
asset_content_type: application/gzip
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
- name: Publish to PyPI
|
|
90
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [dev, main]
|
|
6
|
+
paths: [src/**, tests/**]
|
|
7
|
+
pull_request:
|
|
8
|
+
paths: [src/**, tests/**]
|
|
9
|
+
workflow_call:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
black:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Install UV
|
|
23
|
+
uses: astral-sh/setup-uv@v3
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --all-extras
|
|
29
|
+
|
|
30
|
+
- name: Check code formatting with Black
|
|
31
|
+
run: uv run black --check --diff --color src/ tests/
|
|
32
|
+
|
|
33
|
+
pyright:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- name: Set up Python
|
|
39
|
+
uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.10"
|
|
42
|
+
|
|
43
|
+
- name: Install UV
|
|
44
|
+
uses: astral-sh/setup-uv@v3
|
|
45
|
+
with:
|
|
46
|
+
enable-cache: true
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: uv sync --all-extras
|
|
50
|
+
|
|
51
|
+
- name: Run PyRight type checking
|
|
52
|
+
run: |
|
|
53
|
+
uv run pyright src/asyncapi_python
|
|
54
|
+
uv run pyright src/asyncapi_python_codegen
|
|
55
|
+
|
|
56
|
+
test:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
|
|
59
|
+
strategy:
|
|
60
|
+
matrix:
|
|
61
|
+
python_version: ["3.10", "3.11", "3.12", "3.13"]
|
|
62
|
+
|
|
63
|
+
services:
|
|
64
|
+
rabbitmq:
|
|
65
|
+
image: rabbitmq:3.13.6
|
|
66
|
+
ports:
|
|
67
|
+
- 5672:5672
|
|
68
|
+
options: >-
|
|
69
|
+
--health-cmd "rabbitmq-diagnostics -q ping"
|
|
70
|
+
--health-interval 10s
|
|
71
|
+
--health-timeout 5s
|
|
72
|
+
--health-retries 5
|
|
73
|
+
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v4
|
|
76
|
+
|
|
77
|
+
- name: Set up Python
|
|
78
|
+
uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ matrix.python_version }}
|
|
81
|
+
|
|
82
|
+
- name: Install UV
|
|
83
|
+
uses: astral-sh/setup-uv@v3
|
|
84
|
+
with:
|
|
85
|
+
enable-cache: true
|
|
86
|
+
|
|
87
|
+
- name: Install dependencies
|
|
88
|
+
run: uv sync --all-extras
|
|
89
|
+
|
|
90
|
+
- name: Wait for RabbitMQ to be ready
|
|
91
|
+
run: |
|
|
92
|
+
timeout 60s bash -c 'until nc -z localhost 5672; do sleep 1; done'
|
|
93
|
+
sleep 5 # Additional wait to ensure RabbitMQ is fully initialized
|
|
94
|
+
|
|
95
|
+
- name: Run tests
|
|
96
|
+
env:
|
|
97
|
+
PYTEST_AMQP_URI: amqp://guest:guest@localhost:5672/
|
|
98
|
+
run: uv run pytest
|