zre 0.1.0__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.
- zre-0.1.0/CHANGELOG.md +30 -0
- zre-0.1.0/CODE_OF_CONDUCT.md +74 -0
- zre-0.1.0/CONTRIBUTING.md +60 -0
- zre-0.1.0/LICENSE +21 -0
- zre-0.1.0/MANIFEST.in +12 -0
- zre-0.1.0/PKG-INFO +608 -0
- zre-0.1.0/README.md +572 -0
- zre-0.1.0/SECURITY.md +47 -0
- zre-0.1.0/pyproject.toml +93 -0
- zre-0.1.0/setup.cfg +4 -0
- zre-0.1.0/tests/__init__.py +1 -0
- zre-0.1.0/tests/test_lan.py +583 -0
- zre-0.1.0/tests/test_wan.py +446 -0
- zre-0.1.0/zre/__init__.py +6 -0
- zre-0.1.0/zre/node.py +1091 -0
- zre-0.1.0/zre.egg-info/PKG-INFO +608 -0
- zre-0.1.0/zre.egg-info/SOURCES.txt +18 -0
- zre-0.1.0/zre.egg-info/dependency_links.txt +1 -0
- zre-0.1.0/zre.egg-info/requires.txt +9 -0
- zre-0.1.0/zre.egg-info/top_level.txt +1 -0
zre-0.1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-09-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Pure Python ZRE (ZeroMQ Realtime Exchange Protocol, RFC 36) implementation
|
|
13
|
+
built on asyncio + pyzmq — single event loop, no threads, no C extensions
|
|
14
|
+
beyond pyzmq.
|
|
15
|
+
- Zero-configuration LAN peer discovery via UDP beacons (port 15670).
|
|
16
|
+
- Direct peer dialing with `connect_peer(host, port)` across subnets/WAN,
|
|
17
|
+
including NAT port-forwarding via `set_advertised_endpoint()`.
|
|
18
|
+
- Group messaging (`join`/`leave`/`shout`) and direct messaging (`whisper`).
|
|
19
|
+
- Heartbeating with evasive/expired detection (`ENTER`/`EXIT`/`EVASIVE` events).
|
|
20
|
+
- Custom headers exchanged during discovery via `set_header()` (`X-` headers).
|
|
21
|
+
- Fixed ROUTER port (`set_beacon_peer_port`) and interface pinning
|
|
22
|
+
(`set_interface`) for repeatable deployments.
|
|
23
|
+
- Wire-compatible with any RFC 36 peer: UDP beacon (`ZRE\x01` + UUID + port)
|
|
24
|
+
and `HELLO/WHISPER/SHOUT/JOIN/LEAVE/PING/PING_OK` with `0xAAA1`/v2/seq.
|
|
25
|
+
- 65 tests covering LAN discovery, WAN direct connect, and protocol edge cases.
|
|
26
|
+
- 17 validated examples: chat, service discovery, sensor network, file
|
|
27
|
+
transfer, media streaming, game sync, task queue, whiteboard, presence,
|
|
28
|
+
config sync, health monitor, distributed lock, secure chat, benchmark.
|
|
29
|
+
|
|
30
|
+
[0.1.0]: https://github.com/pitch-cardinal-coding/zre/releases/tag/v0.1.0
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances
|
|
31
|
+
of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards
|
|
42
|
+
of acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for
|
|
49
|
+
moderation decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies
|
|
54
|
+
when an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail
|
|
56
|
+
address, posting via an official social media account, or acting as an
|
|
57
|
+
appointed representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
**theichux@gmail.com**. All complaints will be reviewed and investigated
|
|
64
|
+
promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Attribution
|
|
70
|
+
|
|
71
|
+
This Code of Conduct is adapted from the
|
|
72
|
+
[Contributor Covenant](https://www.contributor-covenant.org), version 2.1,
|
|
73
|
+
available at
|
|
74
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Contributing to zre
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing! This document covers the basics for
|
|
4
|
+
getting a development environment running and submitting changes.
|
|
5
|
+
|
|
6
|
+
## Development setup
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# Create a virtualenv (any Python >= 3.9 works; tested on 3.14)
|
|
10
|
+
python3 -m venv .venv
|
|
11
|
+
source .venv/bin/activate
|
|
12
|
+
|
|
13
|
+
# Install in editable mode with dev tools
|
|
14
|
+
pip install -e .[dev]
|
|
15
|
+
|
|
16
|
+
# Or install the pinned runtime/dev stack
|
|
17
|
+
pip install -r requirements.txt
|
|
18
|
+
pip install -e .
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Running tests and lint
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
make test # pytest (65 tests)
|
|
25
|
+
make lint # ruff check zre tests examples
|
|
26
|
+
make format # ruff format
|
|
27
|
+
make ci # check-format + lint + test
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Notes:
|
|
31
|
+
|
|
32
|
+
- Tests use real UDP beacons on loopback (`127.255.255.255` / `127.0.0.1`),
|
|
33
|
+
so they work inside containers and CI without extra setup.
|
|
34
|
+
- Tests need the ability to bind UDP ports and localhost TCP sockets.
|
|
35
|
+
- The library imports `fcntl` at module load, so it targets POSIX (Linux,
|
|
36
|
+
macOS). Windows is not supported.
|
|
37
|
+
|
|
38
|
+
## Pull requests
|
|
39
|
+
|
|
40
|
+
1. Fork the repo and create a topic branch from `main`.
|
|
41
|
+
2. Make your change. Add tests for anything behavioral — new protocol
|
|
42
|
+
handling, timers, or peer state transitions especially.
|
|
43
|
+
3. Run `make ci` and make sure it passes.
|
|
44
|
+
4. Keep the wire format untouched: `zre` speaks RFC 36 on the wire. If your
|
|
45
|
+
change would alter framing, sequencing, or beacon layout, open an issue
|
|
46
|
+
first to discuss it.
|
|
47
|
+
5. Update `CHANGELOG.md` under an "Unreleased" heading.
|
|
48
|
+
6. Open the PR with a short description of what changed and why.
|
|
49
|
+
|
|
50
|
+
## Reporting bugs
|
|
51
|
+
|
|
52
|
+
Open a [GitHub issue](https://github.com/pitch-cardinal-coding/zre/issues)
|
|
53
|
+
with your Python version, OS, and a minimal reproduction (one of the
|
|
54
|
+
`examples/` scripts usually works well). For security-sensitive reports, see
|
|
55
|
+
[SECURITY.md](SECURITY.md).
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
By contributing, you agree that your contributions will be licensed under
|
|
60
|
+
the [MIT License](LICENSE).
|
zre-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chukwudi Nwachukwu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
zre-0.1.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Include OSS/community docs in the source distribution
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CONTRIBUTING.md
|
|
5
|
+
include CODE_OF_CONDUCT.md
|
|
6
|
+
include SECURITY.md
|
|
7
|
+
include README.md
|
|
8
|
+
|
|
9
|
+
# Tests ship with the sdist so downstream packagers can run them
|
|
10
|
+
recursive-include tests *.py
|
|
11
|
+
|
|
12
|
+
# Keep ruff config available (it lives in pyproject.toml, included by default)
|