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
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ jobs:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- run: just publish
- if: startsWith(github.ref_name, 'stompman')
run: just publish stompman
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

- if: startsWith(github.ref_name, 'faststream-stomp')
run: just publish faststream-stomp
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ FROM ${PYTHON_IMAGE}
RUN pip install uv

WORKDIR /app

# Copy rarely changing files first
COPY pyproject.toml README.md ./
COPY stompman/__init__.py stompman/__init__.py
COPY packages/stompman/stompman/__init__.py packages/stompman/stompman/__init__.py
COPY packages/stompman/pyproject.toml packages/stompman/pyproject.toml
COPY packages/faststream-stomp/README.md packages/faststream-stomp/README.md
COPY packages/faststream-stomp/pyproject.toml packages/faststream-stomp/pyproject.toml
COPY packages/faststream-stomp/faststream_stomp/__init__.py packages/faststream-stomp/faststream_stomp/__init__.py

ENV SETUPTOOLS_SCM_PRETEND_VERSION=0
RUN --mount=type=cache,target=~/.cache/uv \
uv lock && uv sync
ls packages/faststream-stomp && uv lock && uv sync
COPY . .
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test *args:
test-integration *args:
#!/bin/bash
trap 'echo; docker compose down --remove-orphans' EXIT
docker compose run --build --rm app .venv/bin/pytest tests/integration.py --no-cov {{args}}
docker compose run --build --rm app .venv/bin/pytest packages/stompman/test_stompman/integration.py --no-cov {{args}}

run-artemis:
#!/bin/bash
Expand All @@ -26,7 +26,7 @@ run-consumer:
run-producer:
uv run examples/producer.py

publish:
publish package:
rm -rf dist
uv build
uv build --package {{package}}
uv publish --token $PYPI_TOKEN
2 changes: 2 additions & 0 deletions packages/faststream-stomp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# FastStream STOMP broker

File renamed without changes.
32 changes: 32 additions & 0 deletions packages/faststream-stomp/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[project]
name = "faststream-stomp"
description = "FastStream STOMP broker"
authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }]
dependencies = ["faststream>=0.5", "stompman"]
requires-python = ">=3.11"
readme = "README.md"
license = { text = "MIT" }
keywords = ["faststream", "stomp", "artemis", "activemq", "messaging", "jms"]
classifiers = [
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Networking",
"Typing :: Typed",
]
dynamic = ["version"]

[project.urls]
repository = "https://github.com/vrslev/stompman"

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"
raw-options.root = "../.."
fallback-version = "0"

[tool.hatch.build]
include = ["faststream_stomp"]
37 changes: 37 additions & 0 deletions packages/stompman/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[project]
name = "stompman"
description = "Python STOMP client with pleasant API"
authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }]
dependencies = []
requires-python = ">=3.11"
license = { text = "MIT" }
keywords = ["stomp", "artemis", "activemq", "messaging", "jms"]
classifiers = [
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Networking",
"Typing :: Typed",
]
dynamic = ["version", "readme"]

[project.urls]
repository = "https://github.com/vrslev/stompman"

[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"
raw-options.root = "../.."
fallback-version = "0"

[tool.hatch.build]
include = ["stompman"]

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "../../README.md"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
from typing import Any, Literal, Self, TypeVar

import pytest
from polyfactory.factories.dataclass_factory import DataclassFactory

import stompman
from polyfactory.factories.dataclass_factory import DataclassFactory
from stompman.connection import AbstractConnection
from stompman.connection_lifespan import AbstractConnectionLifespan
from stompman.connection_manager import ConnectionManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
from uuid import uuid4

import pytest
from hypothesis import given, strategies

import stompman
from hypothesis import given, strategies
from stompman.serde import (
COMMANDS_TO_FRAMES,
NEWLINE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import faker
import pytest
from polyfactory.factories.typed_dict_factory import TypedDictFactory

import stompman
from polyfactory.factories.typed_dict_factory import TypedDictFactory
from stompman.config import MultiHostHostLike


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from unittest import mock

import pytest

from stompman import (
AnyServerFrame,
BeginFrame,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import faker
import pytest

import stompman.connection_lifespan
from stompman import (
AnyServerFrame,
Expand All @@ -22,7 +21,8 @@
ReceiptFrame,
UnsupportedProtocolVersion,
)
from tests.conftest import (

from test_stompman.conftest import (
BaseMockConnection,
EnrichedClient,
build_dataclass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from unittest import mock

import pytest

from stompman import (
AnyServerFrame,
ConnectedFrame,
Expand All @@ -18,7 +17,8 @@
MessageFrame,
)
from stompman.connection_manager import ActiveConnectionState
from tests.conftest import BaseMockConnection, EnrichedConnectionManager, NoopLifespan, build_dataclass

from test_stompman.conftest import BaseMockConnection, EnrichedConnectionManager, NoopLifespan, build_dataclass

pytestmark = [pytest.mark.anyio, pytest.mark.usefixtures("mock_sleep")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any

import pytest

import stompman
from tests.conftest import build_dataclass

from test_stompman.conftest import build_dataclass


@pytest.mark.parametrize(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

from stompman import (
AckFrame,
AnyClientFrame,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import faker
import pytest

import stompman.subscription
from stompman import (
AckFrame,
Expand All @@ -21,7 +20,8 @@
SubscribeFrame,
UnsubscribeFrame,
)
from tests.conftest import (

from test_stompman.conftest import (
CONNECT_FRAME,
CONNECTED_FRAME,
EnrichedClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

import faker
import pytest

import stompman.transaction
from stompman import (
AbortFrame,
BeginFrame,
CommitFrame,
SendFrame,
)
from tests.conftest import (

from test_stompman.conftest import (
CONNECT_FRAME,
CONNECTED_FRAME,
EnrichedClient,
Expand Down
34 changes: 10 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
[project]
name = "stompman"
description = "Python STOMP client with pleasant API"
authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }]
dependencies = []
name = "stompman-workspace"
requires-python = ">=3.11"
readme = "README.md"
license = { text = "MIT" }
keywords = ["stomp", "artemis", "activemq", "messaging", "jms"]
classifiers = [
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Networking",
"Typing :: Typed",
]
dynamic = ["version"]

[project.urls]
repository = "https://github.com/vrslev/stompman"
version = "0"

[dependency-groups]
dev = [
Expand All @@ -32,12 +16,14 @@ dev = [
"uvloop==0.21.0",
]

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.uv]
package = false

[tool.uv.workspace]
members = ["packages/*"]

[tool.hatch.version]
source = "vcs"
[tool.uv.sources]
stompman = { workspace = true }


[tool.mypy]
Expand Down Expand Up @@ -66,7 +52,7 @@ ignore = [
"PLC2801",
"PLR0913",
]
extend-per-file-ignores = { "tests/*" = ["S101", "SLF001", "ARG", "PLR6301"] }
extend-per-file-ignores = { "*/test_*/*" = ["S101", "SLF001", "ARG", "PLR6301"] }

[tool.pytest.ini_options]
addopts = "--cov -s -vv"
Expand Down