Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python packaging + installability #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
- run: pip install build
- run: python -m build .
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.pyc
__pycache__
*.egg-info
*.log
*.py[cod]
*~
/build
/dist
tests
File renamed without changes.
55 changes: 52 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

The Paho Testing Utilities are a collection of code and tools to help test MQTT clients and Brokers.

All the features are currently in the interoperability directory. The components, or capabilities include:
The components, or capabilities include:

- a Python MQTT broker which implements versions 3.1.1 and 5.0 (plus the start of MQTT-SN support)
- a simple Python MQTT client, also supporting versions 3.1.1 and 5.0, used for simple general test suites
- an MQTT network proxy, which can forward traffic to and from a broker, and display the MQTT packet info
- Python modules to de/serialize MQTT packets for MQTT 3.1.1 and 5.0
- an MQTT load/connection loss test, designed to investigate the reconnection logic for QoS 1 and 2 flows

Check the readme in the interoperability directory for details.

## Links

- Project Website: [https://www.eclipse.org/paho](https://www.eclipse.org/paho)
Expand All @@ -21,3 +19,54 @@ Check the readme in the interoperability directory for details.
- Twitter: [@eclipsepaho](https://twitter.com/eclipsepaho)
- Issues: [https://github.com/eclipse/paho.mqtt.testing/issues](https://github.com/eclipse/paho.mqtt.testing/issues)
- Mailing-list: [https://dev.eclipse.org/mailman/listinfo/paho-dev](https://dev.eclipse.org/mailman/listinfo/paho-dev)

## Usage

### MQTT Version 5

Start a broker:

python3 startbroker.py

Run client tests:

python3 client_test5.py

various options are available, individual tests can be run with:

python3 client_test5.py Test.test_name

As yet unimplemented features:

https://github.com/eclipse/paho.mqtt.testing/issues

Sub-packages:

mqtt/formats/MQTTV5 - packet serialization and deserialization
mqtt/clients/V5 - test client implementation
mqtt/brokers/V5 - test broker implementation

### MQTT Version 3

Start a broker:

python3 startbroker.py

Run client tests:

python3 client_test.py

### TLS

A configuration file similar to that of Eclipse Mosquitto can be passed to startbroker:

python3 startbroker.py -c client_testing.conf

so for example, a TCP listener with TLS support can be configured like this:

listener 18884
cafile tls_testing/keys/all-ca.crt
certfile tls_testing/keys/server/server.crt
keyfile tls_testing/keys/server/server.key
require_certificate true

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions interoperability/.gitignore

This file was deleted.

53 changes: 0 additions & 53 deletions interoperability/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "paho-mqtt-testing"
dynamic = ["version"]
description = ""
readme = "README.md"
requires-python = ">=3.8"
keywords = []
authors = []
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []

[project.urls]
Documentation = "https://github.com/eclipse/paho.mqtt.testing#readme"
Issues = "https://github.com/eclipse/paho.mqtt.testing/issues"
Source = "https://github.com/eclipse/paho.mqtt.testing"

[tool.hatch.version]
source = "vcs"

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.hatch.build.targets.wheel]
packages = ["mqtt"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.