DefStream-Redis 0.1.1__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.
- defstream_redis-0.1.1/DefStream_Redis.egg-info/PKG-INFO +143 -0
- defstream_redis-0.1.1/DefStream_Redis.egg-info/SOURCES.txt +20 -0
- defstream_redis-0.1.1/DefStream_Redis.egg-info/dependency_links.txt +1 -0
- defstream_redis-0.1.1/DefStream_Redis.egg-info/requires.txt +2 -0
- defstream_redis-0.1.1/DefStream_Redis.egg-info/top_level.txt +1 -0
- defstream_redis-0.1.1/LICENSE +674 -0
- defstream_redis-0.1.1/MANIFEST.in +1 -0
- defstream_redis-0.1.1/PKG-INFO +143 -0
- defstream_redis-0.1.1/README.md +113 -0
- defstream_redis-0.1.1/VERSION +1 -0
- defstream_redis-0.1.1/setup.cfg +4 -0
- defstream_redis-0.1.1/setup.py +59 -0
- defstream_redis-0.1.1/src/Configuration.py +59 -0
- defstream_redis-0.1.1/src/Connection.py +174 -0
- defstream_redis-0.1.1/src/Consumer.py +209 -0
- defstream_redis-0.1.1/src/Event.py +83 -0
- defstream_redis-0.1.1/src/Queue.py +151 -0
- defstream_redis-0.1.1/src/Serializer.py +48 -0
- defstream_redis-0.1.1/src/Subscription.py +46 -0
- defstream_redis-0.1.1/src/__init__.py +29 -0
- defstream_redis-0.1.1/test/test_redis.py +292 -0
- defstream_redis-0.1.1/test/test_redis_integration.py +322 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: DefStream-Redis
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Redis Streams broker adapter for DefStream
|
|
5
|
+
Home-page: https://github.com/yong5eon/DefStream-Redis
|
|
6
|
+
Author: Heo Yongseon
|
|
7
|
+
Project-URL: Source, https://github.com/yong5eon/DefStream-Redis
|
|
8
|
+
Project-URL: Issues, https://github.com/yong5eon/DefStream-Redis/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: DefStream>=0.1.0
|
|
19
|
+
Requires-Dist: redis>=5.1.1
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: classifier
|
|
22
|
+
Dynamic: description
|
|
23
|
+
Dynamic: description-content-type
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
Dynamic: project-url
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
30
|
+
|
|
31
|
+
# DefStream-Redis
|
|
32
|
+
|
|
33
|
+
## CI and PyPI releases
|
|
34
|
+
|
|
35
|
+
The `CI` workflow tests PRs targeting `master` and pushes to `master` on Python
|
|
36
|
+
3.9 through 3.14. It builds all three DefStream packages from source, installs
|
|
37
|
+
their wheels in a clean environment, and runs this repository's tests with
|
|
38
|
+
RabbitMQ 4.1 and Redis 7.4 service containers. The current repository uses the
|
|
39
|
+
event commit; sibling repositories use their `master` branches, with resolved
|
|
40
|
+
commit IDs recorded in the log. All three GitHub repositories must be accessible.
|
|
41
|
+
This bootstrap setup does not require existing PyPI releases and does not
|
|
42
|
+
certify compatibility with previously published dependencies.
|
|
43
|
+
|
|
44
|
+
On a `master` push, the build uses `major.minor.<github.run_number>` from the
|
|
45
|
+
checked-in `VERSION` (for example, `0.1.42`). PR builds retain `VERSION`. No
|
|
46
|
+
version commit, PR, or tag is created. Change major/minor to start a new series;
|
|
47
|
+
run numbers can have gaps. Check for PyPI version collisions before replacing
|
|
48
|
+
or renaming the workflow.
|
|
49
|
+
|
|
50
|
+
Only after all six Python checks pass does a separate publish job upload the
|
|
51
|
+
exact Python 3.13 build artifacts. A fully published version is skipped on a
|
|
52
|
+
rerun; first-attempt collisions, incomplete releases, and unexpected network
|
|
53
|
+
errors fail. Active runs are not cancelled; older pending runs may be superseded.
|
|
54
|
+
|
|
55
|
+
Configure `PYPI_API_TOKEN` as a repository Actions secret or a secret in the
|
|
56
|
+
`pypi` environment. Restrict that environment to `master`; omit approval rules
|
|
57
|
+
for fully automatic releases. Protect `master` with required PRs and all six
|
|
58
|
+
`Test Python 3.x` checks, not the push-only `Publish PyPI` job. Never commit the
|
|
59
|
+
token. Publish the core before this adapter so users can resolve its dependency.
|
|
60
|
+
|
|
61
|
+
Redis Streams broker adapter for DefStream, distributed separately from the
|
|
62
|
+
core. Requires Python 3.9 or newer and Redis 6.2 or newer.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
pip install DefStream-Redis
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This installs `DefStream>=0.1.0` and `redis>=5.1.1`. The distribution name is
|
|
71
|
+
`DefStream-Redis`; the Python import path remains
|
|
72
|
+
`DefStream.Broker.Implements.Redis`.
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from DefStream.Broker.Implements.Redis import (
|
|
78
|
+
Configuration,
|
|
79
|
+
Connection,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
broker = Connection(Configuration(
|
|
83
|
+
host='127.0.0.1',
|
|
84
|
+
port=6379,
|
|
85
|
+
))
|
|
86
|
+
broker.connect()
|
|
87
|
+
try:
|
|
88
|
+
broker.create_queue('tasks')
|
|
89
|
+
broker.queue('tasks').send({'message': 'hello'})
|
|
90
|
+
finally:
|
|
91
|
+
broker.close()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
A reachable Redis server is required. The adapter uses Redis Streams, not
|
|
95
|
+
Pub/Sub or lists. It provides stream-backed queues, consumer groups,
|
|
96
|
+
subscriptions, and error policies. Use its `Connection` with
|
|
97
|
+
`DefStream.Worker.Worker` for worker execution.
|
|
98
|
+
|
|
99
|
+
`ConnectionType.Pool` is the default; `ConnectionType.Cluster` uses Redis
|
|
100
|
+
Cluster and requires database 0. Exchanges and RPC are not supported.
|
|
101
|
+
|
|
102
|
+
## Source layout
|
|
103
|
+
|
|
104
|
+
The contents of the former `DefStream/src/Broker/Implements/Redis` directory
|
|
105
|
+
now live directly in this project's [src](./src) directory. Packaging maps that
|
|
106
|
+
directory to `DefStream.Broker.Implements.Redis`; this distribution does not
|
|
107
|
+
own or overwrite the parent packages supplied by DefStream.
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
With the core and both adapters checked out as sibling directories, run this
|
|
112
|
+
from their common parent using your virtual environment's Python:
|
|
113
|
+
|
|
114
|
+
```powershell
|
|
115
|
+
python -m pip install --config-settings editable_mode=strict -e .\DefStream
|
|
116
|
+
python -m pip install -e .\DefStream-RabbitMQ -e .\DefStream-Redis
|
|
117
|
+
python -m unittest discover -s .\DefStream-Redis\test -p "test_*.py"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The core uses strict editable mode to prevent the adapters' editable namespace
|
|
121
|
+
entries from masking its packages. Keep the core's generated `build` link tree;
|
|
122
|
+
reinstall the core after adding or removing its modules. Adapters use default
|
|
123
|
+
editable mode.
|
|
124
|
+
|
|
125
|
+
Redis-specific tests live in this project's `test` directory, covering
|
|
126
|
+
connections, queues, consumers, serialization, and broker integration.
|
|
127
|
+
Broker examples live in `sample`. Shared Worker, Inspector, and cross-adapter
|
|
128
|
+
contract tests remain in the DefStream repository and require both adapters.
|
|
129
|
+
|
|
130
|
+
Run `python -m unittest discover -s test -p "test_*.py"` from this project
|
|
131
|
+
directory after installation. Integration tests are opt-in via
|
|
132
|
+
`DEFSTREAM_REDIS_TESTS=1`; ordinary unit tests do not require a running broker
|
|
133
|
+
or the RabbitMQ adapter. The integration suite exercises standalone Redis,
|
|
134
|
+
not Redis Cluster.
|
|
135
|
+
|
|
136
|
+
Do not combine editable installs with a `site-packages/DefStream` link pointing
|
|
137
|
+
directly at the core source: installing adapter files through that link can
|
|
138
|
+
write into the core checkout. Remove such a link before installing the projects.
|
|
139
|
+
Reinstall after changing package metadata or dependencies.
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
See [LICENSE](./LICENSE), copied unchanged from DefStream.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
VERSION
|
|
5
|
+
setup.py
|
|
6
|
+
DefStream_Redis.egg-info/PKG-INFO
|
|
7
|
+
DefStream_Redis.egg-info/SOURCES.txt
|
|
8
|
+
DefStream_Redis.egg-info/dependency_links.txt
|
|
9
|
+
DefStream_Redis.egg-info/requires.txt
|
|
10
|
+
DefStream_Redis.egg-info/top_level.txt
|
|
11
|
+
src/Configuration.py
|
|
12
|
+
src/Connection.py
|
|
13
|
+
src/Consumer.py
|
|
14
|
+
src/Event.py
|
|
15
|
+
src/Queue.py
|
|
16
|
+
src/Serializer.py
|
|
17
|
+
src/Subscription.py
|
|
18
|
+
src/__init__.py
|
|
19
|
+
test/test_redis.py
|
|
20
|
+
test/test_redis_integration.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DefStream
|