Skip to content

Commit 6313f56

Browse files
committed
added renovate, versioning and GPL v3 license
1 parent e145d96 commit 6313f56

12 files changed

Lines changed: 911 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e .
28+
29+
- name: Run unit tests
30+
run: |
31+
python -m unittest discover tests -v -k "not test_e2e"
32+
33+
- name: Run end-to-end tests
34+
run: |
35+
python -m unittest tests.test_e2e -v
36+
continue-on-error: true # E2E tests may fail due to network issues

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2024-11-16
9+
10+
### Added
11+
- Initial release of meshtastic-mqtt-protobuf CLI tool
12+
- Licensed under GNU General Public License v3.0 or later (GPL-3.0-or-later)
13+
- Command-line interface for sending protobuf-encoded messages to Meshtastic MQTT servers
14+
- Support for broadcast and direct messaging
15+
- Acknowledgment request functionality
16+
- Configurable hop limit for message propagation
17+
- YAML configuration file support with CLI argument overrides
18+
- Comprehensive error handling with specific exit codes
19+
- Verbose logging mode for debugging
20+
- Full protobuf compatibility with Meshtastic specification
21+
- End-to-end tests with actual MQTT broker
22+
- Protobuf compatibility validation tests
23+
- Complete documentation in README.md
24+
25+
### Features
26+
- Connect to any Meshtastic MQTT broker
27+
- Send text messages using native protobuf format
28+
- Configure via YAML file or command-line arguments
29+
- Support for multiple regions and channels
30+
- Automatic packet ID generation
31+
- UTF-8 text encoding with Unicode support
32+
- QoS 1 message delivery for reliability
33+
34+
### Dependencies
35+
- meshtastic>=2.2.0
36+
- paho-mqtt>=1.6.1
37+
- PyYAML>=6.0
38+
39+
## [Unreleased]
40+
41+
### Planned
42+
- Support for additional message types (position, telemetry)
43+
- Message subscription and listening capabilities
44+
- Interactive mode for continuous messaging
45+
- Message history and logging
46+
- Configuration validation command
47+
- Shell completion support
48+
49+
[1.0.0]: https://github.com/yourusername/meshtastic-mqtt-protobuf/releases/tag/v1.0.0

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,18 @@ Contributions are welcome! Please feel free to submit issues or pull requests.
333333

334334
## License
335335

336-
[Add your license here]
336+
This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).
337+
338+
See the [LICENSE](LICENSE) file for the full license text.
339+
340+
### What this means:
341+
342+
- You are free to use, modify, and distribute this software
343+
- If you distribute modified versions, you must also license them under GPL v3
344+
- You must make the source code available when distributing the software
345+
- There is NO WARRANTY for this software
346+
347+
For more information, visit: https://www.gnu.org/licenses/gpl-3.0.html
337348

338349
## Acknowledgments
339350

renovate.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base"
5+
],
6+
"packageRules": [
7+
{
8+
"matchDatasources": ["pypi"],
9+
"matchUpdateTypes": ["minor", "patch"],
10+
"automerge": true,
11+
"automergeType": "pr",
12+
"automergeStrategy": "squash"
13+
},
14+
{
15+
"matchDatasources": ["pypi"],
16+
"matchUpdateTypes": ["major"],
17+
"automerge": false
18+
}
19+
],
20+
"pip_requirements": {
21+
"fileMatch": ["^requirements\\.txt$"]
22+
},
23+
"python": {
24+
"enabled": true
25+
},
26+
"schedule": [
27+
"before 6am on monday"
28+
],
29+
"timezone": "America/New_York",
30+
"labels": ["dependencies"],
31+
"assignees": [],
32+
"reviewers": [],
33+
"prConcurrentLimit": 5,
34+
"prHourlyLimit": 2,
35+
"vulnerabilityAlerts": {
36+
"enabled": true,
37+
"labels": ["security"]
38+
},
39+
"lockFileMaintenance": {
40+
"enabled": false
41+
}
42+
}

setup.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from setuptools import setup, find_packages
44
from pathlib import Path
5+
import re
56

67
# Read the contents of README file
78
this_directory = Path(__file__).parent
@@ -16,27 +17,40 @@
1617
if requirements_path.exists():
1718
requirements = requirements_path.read_text(encoding="utf-8").splitlines()
1819

20+
# Read version from __version__.py
21+
version = "0.1.0" # fallback
22+
version_file = this_directory / "src" / "meshtastic_mqtt_protobuf" / "__version__.py"
23+
if version_file.exists():
24+
version_content = version_file.read_text(encoding="utf-8")
25+
version_match = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', version_content, re.MULTILINE)
26+
if version_match:
27+
version = version_match.group(1)
28+
1929
setup(
2030
name="meshtastic-mqtt-protobuf",
21-
version="0.1.0",
31+
version=version,
2232
author="Meshtastic MQTT Protobuf Contributors",
2333
description="A CLI tool for sending protobuf-encoded messages to Meshtastic MQTT servers",
2434
long_description=long_description,
2535
long_description_content_type="text/markdown",
2636
url="https://github.com/yourusername/meshtastic-mqtt-protobuf",
2737
packages=find_packages(where="src"),
2838
package_dir={"": "src"},
39+
license="GPL-3.0-or-later",
2940
classifiers=[
30-
"Development Status :: 3 - Alpha",
41+
"Development Status :: 4 - Beta",
3142
"Intended Audience :: Developers",
43+
"Intended Audience :: End Users/Desktop",
3244
"Topic :: Communications",
33-
"License :: OSI Approved :: MIT License",
45+
"Topic :: Communications :: Ham Radio",
46+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
3447
"Programming Language :: Python :: 3",
3548
"Programming Language :: Python :: 3.7",
3649
"Programming Language :: Python :: 3.8",
3750
"Programming Language :: Python :: 3.9",
3851
"Programming Language :: Python :: 3.10",
3952
"Programming Language :: Python :: 3.11",
53+
"Programming Language :: Python :: 3.12",
4054
],
4155
python_requires=">=3.7",
4256
install_requires=requirements,

src/meshtastic_mqtt_protobuf/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
A command-line tool for sending protobuf-encoded messages to Meshtastic MQTT servers.
44
"""
55

6-
__version__ = "0.1.0"
6+
from .__version__ import __version__
7+
78
__author__ = "Meshtastic MQTT Protobuf Contributors"
9+
__all__ = ['__version__', '__author__']
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Version information for meshtastic-mqtt-protobuf."""
2+
3+
__version__ = "1.0.0"

src/meshtastic_mqtt_protobuf/cli.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
"""Command-line interface module for Meshtastic MQTT Protobuf tool.
22
3+
Copyright (C) 2024 Meshtastic MQTT Protobuf Contributors
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
318
This module provides the main entry point and orchestration logic for the
419
command-line tool. It coordinates configuration loading, message construction,
520
MQTT connection, and message publishing.
@@ -44,6 +59,15 @@
4459
from .mqtt_client import MeshtasticMQTTClient
4560

4661

62+
def get_version():
63+
"""Get the package version."""
64+
try:
65+
from . import __version__
66+
return __version__
67+
except ImportError:
68+
return "unknown"
69+
70+
4771
# Configure logging
4872
logger = logging.getLogger(__name__)
4973

@@ -160,6 +184,12 @@ def parse_arguments():
160184
help='Enable verbose logging (DEBUG level)'
161185
)
162186

187+
parser.add_argument(
188+
'--version',
189+
action='version',
190+
version=f'%(prog)s {get_version()}'
191+
)
192+
163193
return parser.parse_args()
164194

165195

src/meshtastic_mqtt_protobuf/config.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
"""Configuration management module for YAML config files and CLI overrides.
22
3+
Copyright (C) 2024 Meshtastic MQTT Protobuf Contributors
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
318
This module handles loading configuration from YAML files, merging with
419
command-line argument overrides, and validating required parameters.
520

0 commit comments

Comments
 (0)