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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- uses: auguwu/clippy-action@1.4.0
with:
token: ${{secrets.GITHUB_TOKEN}}
deny: warnings
pytest:
runs-on: ubuntu-latest
steps:
Expand Down
122 changes: 24 additions & 98 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib"]
name = "_inner"
name = "_natsrpy_rs"

[dependencies]
async-nats = "0.46"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ build-backend = "maturin"
[tool.maturin]
bindings = "pyo3"
features = ["pyo3/extension-module"]
module-name = "natsrpy._inner"
module-name = "natsrpy._natsrpy_rs"
python-source = "python"

[tool.mypy]
Expand Down
2 changes: 1 addition & 1 deletion python/natsrpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from natsrpy._inner import Message, Nats, Subscription
from natsrpy._natsrpy_rs import Message, Nats, Subscription

__all__ = [
"Message",
Expand Down
23 changes: 0 additions & 23 deletions python/natsrpy/_inner/js/__init__.pyi

This file was deleted.

10 changes: 0 additions & 10 deletions python/natsrpy/_inner/message.pyi

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from datetime import timedelta
from typing import Any

from natsrpy._inner.js import JetStream
from natsrpy._inner.message import Message
from natsrpy._natsrpy_rs.js import JetStream
from natsrpy._natsrpy_rs.message import Message

class Subscription:
def __aiter__(self) -> Subscription: ...
Expand All @@ -28,7 +28,7 @@ class Nats:
async def publish(
self,
subject: str,
payload: bytes,
payload: bytes | str | bytearray | memoryview,
*,
headers: dict[str, Any] | None = None,
reply: str | None = None,
Expand Down
29 changes: 29 additions & 0 deletions python/natsrpy/_natsrpy_rs/js/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from typing import Any

from .managers import KVManager, StreamsManager

class JetStream:
async def publish(
self,
subject: str,
payload: str | bytes | bytearray | memoryview,
*,
headers: dict[str, str] | None = None,
reply: str | None = None,
err_on_disconnect: bool = False,
) -> None: ...
@property
def kv(self) -> KVManager: ...
@property
def streams(self) -> StreamsManager: ...

class JetStreamMessage:
@property
def subject(self) -> str: ...
@property
def reply(self) -> str | None: ...
@property
def payload(self) -> bytes: ...
@property
def headers(self) -> dict[str, Any]: ...
async def ack(self) -> None: ...
Loading
Loading