Skip to main content

DefStream-Redis

CI and PyPI releases

The CI workflow tests PRs targeting master and pushes to master on Python 3.9 through 3.14. It builds all three DefStream packages from source, installs their wheels in a clean environment, and runs this repository's tests with RabbitMQ 4.1 and Redis 7.4 service containers. The current repository uses the event commit; sibling repositories use their master branches, with resolved commit IDs recorded in the log. All three GitHub repositories must be accessible. This bootstrap setup does not require existing PyPI releases and does not certify compatibility with previously published dependencies.

On a master push, the build uses major.minor.<github.run_number> from the checked-in VERSION (for example, 0.1.42). PR builds retain VERSION. No version commit, PR, or tag is created. Change major/minor to start a new series; run numbers can have gaps. Check for PyPI version collisions before replacing or renaming the workflow.

Only after all six Python checks pass does a separate publish job upload the exact Python 3.13 build artifacts. A fully published version is skipped on a rerun; first-attempt collisions, incomplete releases, and unexpected network errors fail. Active runs are not cancelled; older pending runs may be superseded.

Configure PYPI_API_TOKEN as a repository Actions secret or a secret in the pypi environment. Restrict that environment to master; omit approval rules for fully automatic releases. Protect master with required PRs and all six Test Python 3.x checks, not the push-only Publish PyPI job. Never commit the token. Publish the core before this adapter so users can resolve its dependency.

Redis Streams broker adapter for DefStream, distributed separately from the core. Requires Python 3.9 or newer and Redis 6.2 or newer.

Installation

pip install DefStream-Redis

This installs DefStream>=0.1.0 and redis>=5.1.1. The distribution name is DefStream-Redis; the Python import path remains DefStream.Broker.Implements.Redis.

Usage

from DefStream.Broker.Implements.Redis import (
	Configuration,
	Connection,
)

broker = Connection(Configuration(
	host='127.0.0.1',
	port=6379,
))
broker.connect()
try:
	broker.create_queue('tasks')
	broker.queue('tasks').send({'message': 'hello'})
finally:
	broker.close()

A reachable Redis server is required. The adapter uses Redis Streams, not Pub/Sub or lists. It provides stream-backed queues, consumer groups, subscriptions, and error policies. Use its Connection with DefStream.Worker.Worker for worker execution.

ConnectionType.Pool is the default; ConnectionType.Cluster uses Redis Cluster and requires database 0. Exchanges and RPC are not supported.

Source layout

The contents of the former DefStream/src/Broker/Implements/Redis directory now live directly in this project's src directory. Packaging maps that directory to DefStream.Broker.Implements.Redis; this distribution does not own or overwrite the parent packages supplied by DefStream.

Development

With the core and both adapters checked out as sibling directories, run this from their common parent using your virtual environment's Python:

python -m pip install --config-settings editable_mode=strict -e .\DefStream
python -m pip install -e .\DefStream-RabbitMQ -e .\DefStream-Redis
python -m unittest discover -s .\DefStream-Redis\test -p "test_*.py"

The core uses strict editable mode to prevent the adapters' editable namespace entries from masking its packages. Keep the core's generated build link tree; reinstall the core after adding or removing its modules. Adapters use default editable mode.

Redis-specific tests live in this project's test directory, covering connections, queues, consumers, serialization, and broker integration. Broker examples live in sample. Shared Worker, Inspector, and cross-adapter contract tests remain in the DefStream repository and require both adapters.

Run python -m unittest discover -s test -p "test_*.py" from this project directory after installation. Integration tests are opt-in via DEFSTREAM_REDIS_TESTS=1; ordinary unit tests do not require a running broker or the RabbitMQ adapter. The integration suite exercises standalone Redis, not Redis Cluster.

Do not combine editable installs with a site-packages/DefStream link pointing directly at the core source: installing adapter files through that link can write into the core checkout. Remove such a link before installing the projects. Reinstall after changing package metadata or dependencies.

License

See LICENSE, copied unchanged from DefStream.

Metadata

Release files for DefStream-Redis 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DefStream-Redis 0.1.2
File Size Uploaded
defstream_redis-0.1.2.tar.gz 25.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DefStream-Redis 0.1.2
File Interpreter ABI Platform
defstream_redis-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 48.5 kB

Release files / defstream_redis-0.1.2.tar.gz

Download URL defstream_redis-0.1.2.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8cbcb0d78e7c1e1ea77198930bd19cfb472546491b3a40562ceefefc963b732e
BLAKE2b-256 checksum
How to use checksums
d5c78672f9e0461b77dd4a00c91eed1e5f54fd8b8b99ed7e87ca01f46983ac19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / defstream_redis-0.1.2-py3-none-any.whl

Download URL defstream_redis-0.1.2-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fb7325ffc351d0b34e988157140e94aee634e691135bb38c8aa6ed0507e4a27
BLAKE2b-256 checksum
How to use checksums
be0abdadcd6c843f32b177342d298310eeda7f202cae29cfd7e05f196c539a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page