Skip to content

Commit aba381f

Browse files
Merge branch 'master' into wls_add_types
2 parents 60de9dd + 0bb4b31 commit aba381f

File tree

126 files changed

+11223
-3572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+11223
-3572
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
omit = meshtastic/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py
2+
omit = meshtastic/protobuf/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py
33

44
[report]
55
exclude_lines =

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.{cmd,[cC][mM][dD]} text eol=crlf
33
*.{bat,[bB][aA][tT]} text eol=crlf
44
*.{sh,[sS][hH]} text eol=lf
5+
meshtastic/protobuf/* linguist-generated=true

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,34 @@ jobs:
1313
strategy:
1414
matrix:
1515
python-version:
16-
- "3.8"
1716
- "3.9"
1817
- "3.10"
1918
- "3.11"
19+
- "3.12"
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
- name: Install Python 3
23-
uses: actions/setup-python@v1
23+
uses: actions/setup-python@v5
2424
- name: Uninstall meshtastic
2525
run: |
26-
pip3 uninstall meshtastic
26+
pip3 uninstall -y meshtastic
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip3 install -r requirements.txt
30+
pip3 install poetry
3131
- name: Install meshtastic from local
3232
run: |
33-
pip3 install .
34-
which meshtastic
35-
meshtastic --version
33+
poetry install --all-extras --with dev,powermon
34+
poetry run meshtastic --version
3635
- name: Run pylint
37-
run: pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
36+
run: poetry run pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
3837
- name: Check types with mypy
39-
run: mypy meshtastic/
38+
run: poetry run mypy meshtastic/
4039
- name: Run tests with pytest
41-
run: pytest --cov=meshtastic
40+
run: poetry run pytest --cov=meshtastic
4241
- name: Generate coverage report
4342
run: |
44-
pytest --cov=meshtastic --cov-report=xml
43+
poetry run pytest --cov=meshtastic --cov-report=xml
4544
- name: Upload coverage to Codecov
4645
uses: codecov/codecov-action@v4
4746
with:
@@ -57,16 +56,17 @@ jobs:
5756
strategy:
5857
matrix:
5958
python-version:
60-
- "3.8"
6159
- "3.9"
6260
- "3.10"
6361
- "3.11"
62+
- "3.12"
6463
steps:
65-
- uses: actions/checkout@v2
64+
- uses: actions/checkout@v4
6665
- name: Install Python 3
67-
uses: actions/setup-python@v1
66+
uses: actions/setup-python@v5
6867
- name: Install meshtastic from local
6968
run: |
70-
pip3 install .
71-
which meshtastic
72-
meshtastic --version
69+
python -m pip install --upgrade pip
70+
pip3 install poetry
71+
poetry install
72+
poetry run meshtastic --version

.github/workflows/release.yml

Lines changed: 55 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,37 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.9
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.9"
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip3 install poetry
1626
1727
- name: Bump version
1828
run: >-
19-
bin/bump_version.py
29+
poetry version patch
30+
31+
- name: Get version
32+
id: get_version
33+
run: >-
34+
poetry version --short | sed 's/^/::set-output name=version::/'
2035
21-
- name: Commit updated version.py
36+
- name: Commit updated version.
2237
id: commit_updated
2338
run: |
2439
git config --global user.name 'github-actions'
2540
git config --global user.email 'bot@noreply.github.com'
2641
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
27-
git add setup.py
28-
git commit -m "bump version" && git push || echo "No changes to commit"
42+
git add pyproject.toml
43+
git commit -m "bump version to ${{ steps.get_version.outputs.version }}" && git push || echo "No changes to commit"
2944
git log -n 1 --pretty=format:"%H" | tail -n 1 | awk '{print "::set-output name=sha::"$0}'
3045
31-
- name: Get version
32-
id: get_version
33-
run: >-
34-
bin/show_version.py
35-
3646
- name: Create GitHub release
3747
uses: actions/create-release@v1
3848
id: create_release
@@ -42,31 +52,15 @@ jobs:
4252
prerelease: true
4353
release_name: Meshtastic Python ${{ steps.get_version.outputs.version }}
4454
tag_name: ${{ steps.get_version.outputs.version }}
55+
commitish: ${{ steps.commit_updated.outputs.sha }}
4556
body: |
4657
Autogenerated by github action, developer should edit as required before publishing...
4758
env:
4859
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4960

50-
- name: Set up Python 3.9
51-
uses: actions/setup-python@v2
52-
with:
53-
python-version: 3.9
54-
55-
- name: Install pypa/build
56-
run: >-
57-
python -m
58-
pip install
59-
build
60-
--user
61-
6261
- name: Build a binary wheel and a source tarball
6362
run: >-
64-
python -m
65-
build
66-
--sdist
67-
--wheel
68-
--outdir dist/
69-
.
63+
poetry build
7064
7165
- name: Publish to PyPI
7266
uses: pypa/gh-action-pypi-publish@master
@@ -79,14 +73,14 @@ jobs:
7973
# needs: release_create
8074
# steps:
8175
# - name: Checkout
82-
# uses: actions/checkout@v3
76+
# uses: actions/checkout@v4
8377
# with:
8478
# ref: ${{ needs.release_create.outputs.new_sha }}
8579

8680
# - name: Set up Python 3.9
87-
# uses: actions/setup-python@v2
81+
# uses: actions/setup-python@v5
8882
# with:
89-
# python-version: 3.9
83+
# python-version: "3.9"
9084

9185
# - name: Setup code signing
9286
# env:
@@ -125,21 +119,19 @@ jobs:
125119
needs: release_create
126120
steps:
127121
- name: Checkout
128-
uses: actions/checkout@v3
122+
uses: actions/checkout@v4
129123
with:
130124
ref: ${{ needs.release_create.outputs.new_sha }}
131125

132126
- name: Set up Python 3.9
133-
uses: actions/setup-python@v2
127+
uses: actions/setup-python@v5
134128
with:
135-
python-version: 3.9
129+
python-version: "3.9"
136130

137131
- name: Build
138132
run: |
139-
pip install pyinstaller
140-
pip install -r requirements.txt
141-
pip install .
142-
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
133+
pip install poetry
134+
bin/build-bin.sh
143135
144136
- name: Add ubuntu to release
145137
uses: actions/upload-release-asset@v1
@@ -161,33 +153,31 @@ jobs:
161153
asset_name: readme.txt
162154
asset_content_type: text/plain
163155

164-
build-and-publish-windows:
165-
runs-on: windows-latest
166-
needs: release_create
167-
steps:
168-
- name: Checkout
169-
uses: actions/checkout@v3
170-
with:
171-
ref: ${{ needs.release_create.outputs.new_sha }}
156+
# build-and-publish-windows:
157+
# runs-on: windows-latest
158+
# needs: release_create
159+
# steps:
160+
# - name: Checkout
161+
# uses: actions/checkout@v4
162+
# with:
163+
# ref: ${{ needs.release_create.outputs.new_sha }}
172164

173-
- name: Set up Python 3.9
174-
uses: actions/setup-python@v2
175-
with:
176-
python-version: 3.9
165+
# - name: Set up Python 3.9
166+
# uses: actions/setup-python@v5
167+
# with:
168+
# python-version: "3.9"
177169

178-
- name: Build
179-
run: |
180-
pip install pyinstaller
181-
pip install -r requirements.txt
182-
pip install .
183-
pyinstaller -F -n meshtastic --collect-all meshtastic meshtastic/__main__.py
170+
# - name: Build
171+
# run: |
172+
# pip install poetry
173+
# bin/build-bin.sh
184174

185-
- name: Add windows to release
186-
uses: actions/upload-release-asset@v1
187-
env:
188-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189-
with:
190-
upload_url: ${{ needs.release_create.outputs.upload_url }}
191-
asset_path: dist/meshtastic.exe
192-
asset_name: meshtastic_windows
193-
asset_content_type: application/zip
175+
# - name: Add windows to release
176+
# uses: actions/upload-release-asset@v1
177+
# env:
178+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
179+
# with:
180+
# upload_url: ${{ needs.release_create.outputs.upload_url }}
181+
# asset_path: dist/meshtastic.exe
182+
# asset_name: meshtastic_windows
183+
# asset_content_type: application/zip

.github/workflows/update_protobufs.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
steps:
99
- name: Checkout code
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111
with:
1212
submodules: true
1313

@@ -18,9 +18,14 @@ jobs:
1818
1919
- name: Download nanopb
2020
run: |
21-
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz
22-
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
23-
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
21+
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8-linux-x86.tar.gz
22+
tar xvzf nanopb-0.4.8-linux-x86.tar.gz
23+
mv nanopb-0.4.8-linux-x86 nanopb-0.4.8
24+
25+
- name: Install poetry (needed by regen-protobufs.sh)
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip3 install poetry
2429
2530
- name: Re-generate protocol buffers
2631
run: |
@@ -32,5 +37,5 @@ jobs:
3237
git config --global user.email 'bot@noreply.github.com'
3338
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
3439
git add protobufs
35-
git add meshtastic
40+
git add meshtastic/protobuf
3641
git commit -m "Update protobuf submodule" && git push || echo "No changes to commit"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ __pycache__
1616
examples/__pycache__
1717
meshtastic.spec
1818
.hypothesis/
19+
coverage.xml
20+
.ipynb_checkpoints

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ignore-patterns=mqtt_pb2.py,channel_pb2.py,telemetry_pb2.py,admin_pb2.py,config_
2323
# no Warning level messages displayed, use"--disable=all --enable=classes
2424
# --disable=W"
2525
#
26-
disable=invalid-name,fixme,logging-fstring-interpolation,too-many-statements,too-many-branches,too-many-locals,no-member,f-string-without-interpolation,protected-access,pointless-string-statement,too-few-public-methods,broad-except,no-else-return,no-else-raise,bare-except,too-many-public-methods
26+
disable=invalid-name,fixme,logging-fstring-interpolation,too-many-statements,too-many-branches,too-many-locals,no-member,f-string-without-interpolation,protected-access,pointless-string-statement,too-few-public-methods,broad-except,no-else-return,no-else-raise,bare-except,too-many-public-methods,nested-min-max
2727

2828
[BASIC]
2929

.reuse/dep5

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: Meshtastic Python
3+
Upstream-Contact: Various Authors
4+
Source: https://github.com/meshtastic/python
5+
6+
Files: *
7+
Copyright:
8+
2020-2020 Nils Werner <nils@hey.com>
9+
2020-2020 Paul Vivier <github@vivier.net>
10+
2020-2020 Tim Gunter <tgunter+github@gmail.com>
11+
2020-2021 Charles Crossan <crossan007@gmail.com>
12+
2020-2021 IZ1IVA
13+
2020-2022 Jm Casler <jm@casler.org>
14+
2020-2024 geeksville <kevinh@geeksville.com>
15+
2021-2021 Andrew Cabey <me@acabey.xyz>
16+
2021-2021 dylan <eris.has.a.dad+github@gmail.com>
17+
2021-2021 Fabian Affolter <mail@fabian-affolter.ch>
18+
2021-2021 Foster Irwin <foster@jfirwin.com>
19+
2021-2021 Manuel Giolo <iz1kga@gmail.com>
20+
2021-2021 meehow <michal@ert.pl>
21+
2021-2021 srichs
22+
2021-2021 ChuckNorrison
23+
2021-2021 Aivaras-s
24+
2021-2021 a-f-G-U-C
25+
2021-2021 <Beiri22ny@googlemail.com>
26+
2021-2021 jdstroy
27+
2021-2021 linagee
28+
2021-2021 Simonas <simonas@5grupe.lt>
29+
2021-2022 <mike.kinney@gmail.com>
30+
2021-2023 Sacha Weatherstone <sachaw100@hotmail.com>
31+
2021-2024 Ben Meadors <benmmeadors@gmail.com>
32+
2022-2022 Balázs Kelemen <10376327+prampec
33+
2022-2022 <akadd8@gmail.com>
34+
2022-2022 <a.merino.jimenez@gmail.com>
35+
2022-2022 <ghostop14@gmail.com>
36+
2022-2022 <git@schiraldi.org>
37+
2022-2022 <pavel.b@techspark.engineering>
38+
2022-2022 Rohan King <king.rohan.ja@gmail.com>
39+
2022-2022 Tom Douile
40+
2022-2023 Thomas Göttgens <tgoettgens@gmail.com>
41+
2022-2024 thijs@havinga.eu>
42+
2023-2023 Eli Schleifer <eli@trunk.io>
43+
2023-2023 Manuel <manuel.verch@gmx.de>
44+
2023-2023 Marek Küthe <m.k@mk16.de>
45+
2023-2023 <benlipsey@gmail.com>
46+
2023-2023 <dwelch@structuralcomponents.net>
47+
2023-2023 <henrichhartzer@tuta.io>
48+
2023-2023 luzpaz
49+
2023-2023 <sb@liztv.net>
50+
2023-2023 Toby Murray <toby.murray@protonmail.com>
51+
2023-2024 Brad Midgley <bmidgley@gmail.com>
52+
2024-2024 Ian McEwen <ianmcorvidae@ianmcorvidae.net>
53+
2024-2024 John Hollowell <jhollowe@johnhollowell.com>
54+
2024-2024 Jonathan Bennett <jbennett@incomsystems.biz>
55+
2024-2024 <danwelch3@gmail.com>
56+
2024-2024 <god@yahoo.com>
57+
2024-2024 <herbert.todd@gmail.com>
58+
2024-2024 <jorropo.pgm@gmail.com>
59+
2024-2024 rc14193 <emdort@gmail.com>
60+
2024-2024 Steve Holden <steve@holdenweb.com>
61+
2024-2024 Thomas Herrmann <mail@thoherr.de>
62+
2024-2024 Timothy Harder <harder.timothy.j@gmail.com>
63+
2024-2024 Wolfgang Nagele <mail@wnagele.com>
64+
License: GPL-3.0-only

0 commit comments

Comments
 (0)