From b2593e4bb146e41bf293035bd9e931961d81599f Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Mon, 31 Oct 2022 19:47:42 +1000 Subject: [PATCH 1/2] Changes --- .github/workflows/update_protobufs.yml | 10 +++++----- .gitmodules | 6 +++--- Makefile | 4 ++-- README.md | 10 ++++------ bin/{regen-protos.sh => regen-protosbuf.sh} | 6 +++--- meshtastic/__init__.py | 2 +- meshtastic/util.py | 2 +- proto | 1 - protobufs | 1 + setup.py | 10 +++++----- standalone_readme.txt | 2 +- 11 files changed, 26 insertions(+), 28 deletions(-) rename bin/{regen-protos.sh => regen-protosbuf.sh} (69%) delete mode 160000 proto create mode 160000 protobufs diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index 747749d..d1a4cd6 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -15,22 +15,22 @@ jobs: run: | git pull --recurse-submodules git submodule update --remote --recursive - + - name: Download nanopb run: | wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz tar xvzf nanopb-0.4.6-linux-x86.tar.gz mv nanopb-0.4.6-linux-x86 nanopb-0.4.6 - + - name: Re-generate protocol buffers run: | - ./bin/regen-protos.sh - + ./bin/regen-protobufs.sh + - name: Commit update run: | git config --global user.name 'github-actions' git config --global user.email 'bot@noreply.github.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git add proto + git add protobufs git add meshtastic git commit -m "Update protobuf submodule" && git push || echo "No changes to commit" diff --git a/.gitmodules b/.gitmodules index ddc929e..d155a84 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "proto"] - path = proto - url = https://github.com/meshtastic/Meshtastic-protobufs.git +[submodule "protobufs"] + path = protobufs + url = http://github.com/meshtastic/protobufs diff --git a/Makefile b/Makefile index 1d404f9..f9a43ae 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,11 @@ lint: slow: pytest -m unit --durations=5 -proto: FORCE +protobufs: FORCE git submodule update --init --recursive git pull --rebase git submodule update --remote --merge - ./bin/regen-protos.sh + ./bin/regen-protobufs.sh # run the coverage report and open results in a browser cov: diff --git a/README.md b/README.md index 4217c12..49be189 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Meshtastic Python -[![codecov](https://codecov.io/gh/meshtastic/Meshtastic-python/branch/master/graph/badge.svg?token=TIWPJL73KV)](https://codecov.io/gh/meshtastic/Meshtastic-python) +[![codecov](https://codecov.io/gh/meshtastic/python/branch/master/graph/badge.svg?token=TIWPJL73KV)](https://codecov.io/gh/meshtastic/python) ![PyPI - Downloads](https://img.shields.io/pypi/dm/meshtastic) -[![CI](https://img.shields.io/github/workflow/status/meshtastic/Meshtastic-python/CI?label=actions&logo=github&color=yellow)](https://github.com/meshtastic/Meshtastic-python/actions/workflows/ci.yml) -[![CLA assistant](https://cla-assistant.io/readme/badge/meshtastic/Meshtastic-python)](https://cla-assistant.io/meshtastic/Meshtastic-python) +[![CI](https://img.shields.io/github/workflow/status/meshtastic/python/CI?label=actions&logo=github&color=yellow)](https://github.com/meshtastic/python/actions/workflows/ci.yml) +[![CLA assistant](https://cla-assistant.io/readme/badge/meshtastic/python)](https://cla-assistant.io/meshtastic/python) [![Fiscal Contributors](https://opencollective.com/meshtastic/tiers/badge.svg?label=Fiscal%20Contributors&color=deeppink)](https://opencollective.com/meshtastic/) [![Vercel](https://img.shields.io/static/v1?label=Powered%20by&message=Vercel&style=flat&logo=vercel&color=000000)](https://vercel.com?utm_source=meshtastic&utm_campaign=oss) @@ -14,12 +14,10 @@ This small library (and example application) provides an easy API for sending an It also provides access to any of the operations/data available in the device user interface or the Android application. Events are delivered using a publish-subscribe model, and you can subscribe to only the message types you are interested in. - **[Getting Started Guide](https://meshtastic.org/docs/software/python/python-installation)** **[Documentation/API Reference](https://python.meshtastic.org/)** - ## Stats -![Alt](https://repobeats.axiom.co/api/embed/3d64492daee3a603497071b45e6cdb81d9b2d421.svg "Repobeats analytics image") +![Alt](https://repobeats.axiom.co/api/embed/c71ee8fc4a79690402e5d2807a41eec5e96d9039.svg "Repobeats analytics image") diff --git a/bin/regen-protos.sh b/bin/regen-protosbuf.sh similarity index 69% rename from bin/regen-protos.sh rename to bin/regen-protosbuf.sh index 40f2a79..8d497ba 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protosbuf.sh @@ -1,15 +1,15 @@ #!/bin/bash -./nanopb-0.4.6/generator-bin/protoc -I=proto --python_out meshtastic `ls proto/*.proto` +./nanopb-0.4.6/generator-bin/protoc -I=protobufs --python_out meshtastic `ls protobufs/*.proto` # workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628 if [[ $OSTYPE == 'darwin'* ]]; then sed -i '' -E 's/^(import.*_pb2)/from . \1/' meshtastic/*.py - # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27) + # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27) sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py else sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/*.py - # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27) + # automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27) sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py fi diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index 0ff4b5b..e4a172c 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -3,7 +3,7 @@ Primary class: SerialInterface Install with pip: "[pip3 install meshtastic](https://pypi.org/project/meshtastic/)" -Source code on [github](https://github.com/meshtastic/Meshtastic-python) +Source code on [github](https://github.com/meshtastic/python) properties of SerialInterface: diff --git a/meshtastic/util.py b/meshtastic/util.py index 73bc42a..9ab9c80 100644 --- a/meshtastic/util.py +++ b/meshtastic/util.py @@ -196,7 +196,7 @@ def support_info(): print('') print('If having issues with meshtastic cli or python library') print('or wish to make feature requests, visit:') - print('https://github.com/meshtastic/Meshtastic-python/issues') + print('https://github.com/meshtastic/python/issues') print('When adding an issue, be sure to include the following info:') print(f' System: {platform.system()}') print(f' Platform: {platform.platform()}') diff --git a/proto b/proto deleted file mode 160000 index a79e3ae..0000000 --- a/proto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a79e3aef8117dad642b1a011ec0438619616740c diff --git a/protobufs b/protobufs new file mode 160000 index 0000000..ed9f249 --- /dev/null +++ b/protobufs @@ -0,0 +1 @@ +Subproject commit ed9f2499d692925461facd64c6af2d2a7672245a diff --git a/setup.py b/setup.py index 547845d..f51dd38 100644 --- a/setup.py +++ b/setup.py @@ -16,12 +16,12 @@ setup( description="Python API & client shell for talking to Meshtastic devices", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/meshtastic/Meshtastic-python", - author="Kevin Hester", - author_email="kevinh@geeksville.com", - license="MIT", + url="https://github.com/meshtastic/python", + author="Meshtastic Developers", + author_email="contact@meshtastic.org", + license="GPL-3.0-only", classifiers=[ - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)" "Development Status :: 4 - Beta", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", diff --git a/standalone_readme.txt b/standalone_readme.txt index 88aa8c6..996ff60 100644 --- a/standalone_readme.txt +++ b/standalone_readme.txt @@ -1,5 +1,5 @@ readme.txt for single standalone executable zip files that can be -downloaded from https://github.com/meshtastic/Meshtastic-python/releases +downloaded from https://github.com/meshtastic/python/releases If you do not want to install python and/or the python libraries, you can download one of these files to run the Meshtastic command line interface (CLI) as a standalone executable. From a720916df5686fb5ba21d7fdf0ee5b16fe08a7d0 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 31 Oct 2022 08:00:29 -0500 Subject: [PATCH 2/2] Update version in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f51dd38..270d9e0 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open("README.md", "r") as fh: # This call to setup() does all the work setup( name="meshtastic", - version="1.3.44", + version="2.0.0", description="Python API & client shell for talking to Meshtastic devices", long_description=long_description, long_description_content_type="text/markdown",