Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for setuptools-scm to detect version from tags

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,45 @@ meshcore-proxy --serial /dev/ttyUSB0 --port 5001
- Python 3.10+
- MeshCore companion radio with USB or BLE firmware

## Development

### Building from Source

```bash
git clone --recursive https://github.com/rgregg/meshcore-proxy.git
cd meshcore-proxy
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest
```

### Creating a Release

This project uses [setuptools-scm](https://github.com/pypa/setuptools-scm) for automatic versioning based on git tags.

**Version format:** Tags should follow the pattern `vX.Y.Z` or `vX.Y.Z-alpha` (e.g., `v0.4.0`, `v0.4.0-alpha`)
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation mentions tags can follow the pattern vX.Y.Z or vX.Y.Z-alpha, but the tag regex also accepts -beta and -rc[0-9]+ suffixes. The documentation should be updated to mention all supported tag formats for completeness. Consider updating line 336 to say: "Tags should follow the pattern vX.Y.Z, vX.Y.Z-alpha, vX.Y.Z-beta, or vX.Y.Z-rc<number> (e.g., v0.4.0, v0.4.0-alpha, v0.4.0-beta, v0.4.0-rc1)"

Suggested change
**Version format:** Tags should follow the pattern `vX.Y.Z` or `vX.Y.Z-alpha` (e.g., `v0.4.0`, `v0.4.0-alpha`)
**Version format:** Tags should follow the pattern `vX.Y.Z`, `vX.Y.Z-alpha`, `vX.Y.Z-beta`, or `vX.Y.Z-rc<number>` (e.g., `v0.4.0`, `v0.4.0-alpha`, `v0.4.0-beta`, `v0.4.0-rc1`)

Copilot uses AI. Check for mistakes.

**Release process:**

1. Ensure all changes are committed and pushed
2. Create and push a version tag:
```bash
git tag v0.4.0-alpha
git push origin v0.4.0-alpha
```
3. GitHub Actions will automatically:
- Build the package with the version from the tag
- Publish to PyPI
- Build and publish Docker images to GHCR

**Version resolution:**
- On a tagged commit: uses the exact tag version (e.g., `v0.4.0-alpha` → `0.4.0a0`)
- Between tags: uses a dev version (e.g., `0.4.0a1.dev2` for 2 commits after `v0.4.0-alpha`)

## License

MIT
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
requires = ["setuptools>=61.0", "wheel", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"

[project]
name = "meshcore-proxy"
version = "0.1.0"
dynamic = ["version"]
description = "TCP proxy for MeshCore companion radios"
readme = "README.md"
license = {text = "MIT"}
Expand Down Expand Up @@ -54,3 +54,10 @@ select = ["E", "F", "W", "I", "N", "UP", "B", "C4"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]

[tool.setuptools_scm]
# Use guess-next-dev for versions between tags
# On a tagged commit, this will use the exact tag version
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
tag_regex = "^v(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+(-alpha|-beta|-rc[0-9]+)?)$"
8 changes: 7 additions & 1 deletion src/meshcore_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""MeshCore Proxy - TCP proxy for MeshCore companion radios."""

__version__ = "0.1.0"
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("meshcore-proxy")
except PackageNotFoundError:
# Package is not installed
__version__ = "0.0.0.dev0"
Comment on lines +5 to +9
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new dynamic version resolution logic lacks test coverage. Since this project has comprehensive test coverage for other modules (test_cli.py and test_proxy.py), consider adding a test to verify that the version attribute is correctly set. The test should verify both the successful case (when the package is installed) and the fallback case (when PackageNotFoundError is raised).

Copilot uses AI. Check for mistakes.
Loading