Skip to content

Commit cd5913a

Browse files
committed
WIP switch to using Poetry for builds/dev usage. Looks pretty good
still need to update readme and pypi upload
1 parent 23f41bf commit cd5913a

9 files changed

Lines changed: 1880 additions & 111 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,19 @@ jobs:
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 run meshtastic --version
3634
- name: Run pylint
37-
run: pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
35+
run: poetry run pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
3836
- name: Check types with mypy
3937
run: mypy meshtastic/
4038
- name: Run tests with pytest
41-
run: pytest --cov=meshtastic
39+
run: poetry run pytest --cov=meshtastic
4240
- name: Generate coverage report
4341
run: |
44-
pytest --cov=meshtastic --cov-report=xml
42+
poetry run pytest --cov=meshtastic --cov-report=xml
4543
- name: Upload coverage to Codecov
4644
uses: codecov/codecov-action@v4
4745
with:
@@ -67,6 +65,5 @@ jobs:
6765
uses: actions/setup-python@v1
6866
- name: Install meshtastic from local
6967
run: |
70-
pip3 install .
71-
which meshtastic
68+
poetry install
7269
meshtastic --version

bin/prerelease-tests.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ set -e
33
# You may consider running: "pytest -m smoke1" instead of this test.
44

55
echo "Running (crude) prerelease tests to verify sanity"
6+
7+
# Use the python environment created by poetry
8+
source $(poetry env info --path)/bin/activate
9+
610
echo running hello
711
python3 tests/hello_world.py
8-
# bin/run.sh --help
12+
# meshtastic --help
913
echo toggling router
10-
bin/run.sh --set is_router true
11-
bin/run.sh --set is_router false
14+
meshtastic --set is_router true
15+
meshtastic --set is_router false
1216
# TODO: This does not seem to work.
1317
echo setting channel
14-
bin/run.sh --seturl "https://www.meshtastic.org/c/#GAMiENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ="
18+
meshtastic --seturl "https://www.meshtastic.org/c/#GAMiENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ="
1519
echo setting owner
16-
bin/run.sh --set-owner "Test Build"
20+
meshtastic --set-owner "Test Build"
1721
echo setting position
18-
bin/run.sh --setlat 32.7767 --setlon -96.7970 --setalt 1337
22+
meshtastic --setlat 32.7767 --setlon -96.7970 --setalt 1337
1923
echo dumping info
20-
bin/run.sh --info
24+
meshtastic run meshtastic --info
2125
echo sending closing message
22-
bin/run.sh --sendtext "Sanity complete"
26+
meshtastic --sendtext "Sanity complete"

bin/run.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

bin/test-release.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ set -e
33

44
bin/regen-docs.sh
55
pandoc --from=markdown --to=rst --output=README README.md
6-
python3 setup.py sdist bdist_wheel
7-
python3 -m twine check dist/*
8-
# test the upload
9-
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
6+
7+
poetry publish -r test-pypi --build
108
echo "view the upload at https://test.pypi.org/ it it looks good upload for real"

bin/upload-release.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
rm dist/*
22
set -e
33

4-
python3 setup.py sdist bdist_wheel
5-
python3 -m twine upload dist/*
4+
poetry build
5+
poetry run pytest
6+
poetry publish
7+
#python3 setup.py sdist bdist_wheel
8+
#python3 -m twine upload dist/*

poetry.lock

Lines changed: 1802 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[tool.poetry]
2+
name = "meshtastic"
3+
version = "2.3.7"
4+
description = "Python API & client shell for talking to Meshtastic devices"
5+
authors = ["Meshtastic Developers <contact@meshtastic.org>"]
6+
license = "GPL-3.0-only"
7+
readme = "README.md"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.9,<3.13" # was 3.7 for production but 3.9 is needed for pandas, bleak requires a max of 3.13 for some reason
11+
pyserial = "^3.5"
12+
protobuf = ">=5.26.0"
13+
dotmap = "^1.3.30"
14+
pexpect = "^4.9.0"
15+
pyqrcode = "^1.2.1"
16+
tabulate = "^0.9.0"
17+
timeago = "^1.0.16"
18+
webencodings = "^0.5.1"
19+
requests = "^2.31.0"
20+
pyparsing = "^3.1.2"
21+
pyyaml = "^6.0.1"
22+
pypubsub = "^4.0.3"
23+
bleak = "^0.21.1"
24+
mypy = "^1.10.0"
25+
mypy-protobuf = "^3.6.0"
26+
types-protobuf = "^5.26.0.20240422"
27+
types-tabulate = "^0.9.0.20240106"
28+
types-requests = "^2.31.0.20240406"
29+
types-setuptools = "^69.5.0.20240423"
30+
types-pyyaml = "^6.0.12.20240311"
31+
packaging = "^24.0"
32+
33+
[tool.poetry.group.dev.dependencies]
34+
hypothesis = "^6.103.2"
35+
pytest = "^8.2.2"
36+
pytest-cov = "^5.0.0"
37+
pdoc3 = "^0.10.0"
38+
autopep8 = "^2.1.0"
39+
riden = {git = "https://github.com/shaybox/riden.git"}
40+
pandas = "^2.2.2"
41+
pylint = "^2.11.1"
42+
pytap2 = "^2.3.0"
43+
44+
[tool.poetry.extras]
45+
tunnel = ["pytap2"]
46+
47+
[tool.poetry.scripts]
48+
meshtastic = "meshtastic.__main__:main"
49+
mesh-tunnel = "meshtastic.__main__:tunnelMain [tunnel]"
50+
51+
[build-system]
52+
requires = ["poetry-core"]
53+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)