Skip to content

Commit 16bbc4b

Browse files
authored
Change package layout (#96)
1 parent 5f5ee31 commit 16bbc4b

31 files changed

+112
-50
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: extractions/setup-just@v2
1414
- uses: astral-sh/setup-uv@v5
15-
with:
16-
cache-dependency-glob: "**/pyproject.toml"
17-
- run: just publish
15+
- if: startsWith(github.ref_name, 'stompman')
16+
run: just publish stompman
17+
env:
18+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
19+
20+
- if: startsWith(github.ref_name, 'faststream-stomp')
21+
run: just publish faststream-stomp
1822
env:
1923
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ FROM ${PYTHON_IMAGE}
66
RUN pip install uv
77

88
WORKDIR /app
9+
10+
# Copy rarely changing files first
911
COPY pyproject.toml README.md ./
10-
COPY stompman/__init__.py stompman/__init__.py
12+
COPY packages/stompman/stompman/__init__.py packages/stompman/stompman/__init__.py
13+
COPY packages/stompman/pyproject.toml packages/stompman/pyproject.toml
14+
COPY packages/faststream-stomp/README.md packages/faststream-stomp/README.md
15+
COPY packages/faststream-stomp/pyproject.toml packages/faststream-stomp/pyproject.toml
16+
COPY packages/faststream-stomp/faststream_stomp/__init__.py packages/faststream-stomp/faststream_stomp/__init__.py
1117

1218
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0
1319
RUN --mount=type=cache,target=~/.cache/uv \
14-
uv lock && uv sync
20+
ls packages/faststream-stomp && uv lock && uv sync
1521
COPY . .

Justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test *args:
1313
test-integration *args:
1414
#!/bin/bash
1515
trap 'echo; docker compose down --remove-orphans' EXIT
16-
docker compose run --build --rm app .venv/bin/pytest tests/integration.py --no-cov {{args}}
16+
docker compose run --build --rm app .venv/bin/pytest packages/stompman/test_stompman/integration.py --no-cov {{args}}
1717

1818
run-artemis:
1919
#!/bin/bash
@@ -26,7 +26,7 @@ run-consumer:
2626
run-producer:
2727
uv run examples/producer.py
2828

29-
publish:
29+
publish package:
3030
rm -rf dist
31-
uv build
31+
uv build --package {{package}}
3232
uv publish --token $PYPI_TOKEN

packages/faststream-stomp/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# FastStream STOMP broker
2+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[project]
2+
name = "faststream-stomp"
3+
description = "FastStream STOMP broker"
4+
authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }]
5+
dependencies = ["faststream>=0.5", "stompman"]
6+
requires-python = ">=3.11"
7+
readme = "README.md"
8+
license = { text = "MIT" }
9+
keywords = ["faststream", "stomp", "artemis", "activemq", "messaging", "jms"]
10+
classifiers = [
11+
"Development Status :: 4 - Beta",
12+
"Natural Language :: English",
13+
"Programming Language :: Python :: Implementation :: CPython",
14+
"Topic :: System :: Networking",
15+
"Typing :: Typed",
16+
]
17+
dynamic = ["version"]
18+
19+
[project.urls]
20+
repository = "https://github.com/vrslev/stompman"
21+
22+
[build-system]
23+
requires = ["hatchling", "hatch-vcs"]
24+
build-backend = "hatchling.build"
25+
26+
[tool.hatch.version]
27+
source = "vcs"
28+
raw-options.root = "../.."
29+
fallback-version = "0"
30+
31+
[tool.hatch.build]
32+
include = ["faststream_stomp"]

packages/stompman/pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[project]
2+
name = "stompman"
3+
description = "Python STOMP client with pleasant API"
4+
authors = [{ name = "Lev Vereshchagin", email = "mail@vrslev.com" }]
5+
dependencies = []
6+
requires-python = ">=3.11"
7+
license = { text = "MIT" }
8+
keywords = ["stomp", "artemis", "activemq", "messaging", "jms"]
9+
classifiers = [
10+
"Development Status :: 4 - Beta",
11+
"Natural Language :: English",
12+
"Programming Language :: Python :: Implementation :: CPython",
13+
"Topic :: System :: Networking",
14+
"Typing :: Typed",
15+
]
16+
dynamic = ["version", "readme"]
17+
18+
[project.urls]
19+
repository = "https://github.com/vrslev/stompman"
20+
21+
[build-system]
22+
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
23+
build-backend = "hatchling.build"
24+
25+
[tool.hatch.version]
26+
source = "vcs"
27+
raw-options.root = "../.."
28+
fallback-version = "0"
29+
30+
[tool.hatch.build]
31+
include = ["stompman"]
32+
33+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
34+
content-type = "text/markdown"
35+
36+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
37+
path = "../../README.md"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)