Skip to content

Commit 1a3a840

Browse files
authored
Merge pull request #206 from mkinney/fully_qualify_imports
need to fully qualify imports so projects consuming the library will …
2 parents c049d34 + fe69f05 commit 1a3a840

File tree

13 files changed

+45
-30
lines changed

13 files changed

+45
-30
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version:
16+
- "3.6"
17+
- "3.7"
18+
- "3.8"
19+
- "3.9"
1320
steps:
1421
- uses: actions/checkout@v2
1522
- name: Install Python 3
1623
uses: actions/setup-python@v1
17-
with:
18-
python-version: 3.9
1924
- name: Uninstall meshtastic
2025
run: |
2126
pip3 uninstall meshtastic
@@ -46,12 +51,17 @@ jobs:
4651
fail_ci_if_error: true
4752
validate:
4853
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
python-version:
57+
- "3.6"
58+
- "3.7"
59+
- "3.8"
60+
- "3.9"
4961
steps:
5062
- uses: actions/checkout@v2
5163
- name: Install Python 3
5264
uses: actions/setup-python@v1
53-
with:
54-
python-version: 3.9
5565
- name: Install meshtastic from local
5666
run: |
5767
pip3 install .

meshtastic/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect
7777
from dotmap import DotMap
7878
from tabulate import tabulate
7979
from google.protobuf.json_format import MessageToJson
80-
from .util import fixme, catchAndIgnore, stripnl, DeferredExecution, Timeout
81-
from .node import Node
82-
from . import mesh_pb2, portnums_pb2, apponly_pb2, admin_pb2, environmental_measurement_pb2, remote_hardware_pb2, channel_pb2, radioconfig_pb2, util
80+
from meshtastic.util import fixme, catchAndIgnore, stripnl, DeferredExecution, Timeout
81+
from meshtastic.node import Node
82+
from meshtastic import (mesh_pb2, portnums_pb2, apponly_pb2, admin_pb2,
83+
environmental_measurement_pb2, remote_hardware_pb2,
84+
channel_pb2, radioconfig_pb2, util)
8385

8486
# Note: To follow PEP224, comments should be after the module variable.
8587

meshtastic/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import pkg_resources
1414
import meshtastic.util
1515
import meshtastic.test
16-
from . import remote_hardware
17-
from .ble_interface import BLEInterface
18-
from . import portnums_pb2, channel_pb2, radioconfig_pb2
19-
from .globals import Globals
16+
from meshtastic import remote_hardware
17+
from meshtastic.ble_interface import BLEInterface
18+
from meshtastic import portnums_pb2, channel_pb2, radioconfig_pb2
19+
from meshtastic.globals import Globals
2020

2121

2222
def onReceive(packet, interface):

meshtastic/ble_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pygatt
55

66

7-
from .mesh_interface import MeshInterface
7+
from meshtastic.mesh_interface import MeshInterface
88

99
# Our standard BLE characteristics
1010
TORADIO_UUID = "f75c76d2-129e-4dad-a1dd-7866124401e7"

meshtastic/mesh_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818

1919
import meshtastic.node
20-
from . import portnums_pb2, mesh_pb2
21-
from .util import stripnl, Timeout, our_exit, remove_keys_from_dict, convert_mac_addr
22-
from .__init__ import LOCAL_ADDR, BROADCAST_NUM, BROADCAST_ADDR, ResponseHandler, publishingThread, OUR_APP_VERSION, protocols
20+
from meshtastic import portnums_pb2, mesh_pb2
21+
from meshtastic.util import stripnl, Timeout, our_exit, remove_keys_from_dict, convert_mac_addr
22+
from meshtastic.__init__ import LOCAL_ADDR, BROADCAST_NUM, BROADCAST_ADDR, ResponseHandler, publishingThread, OUR_APP_VERSION, protocols
2323

2424
class MeshInterface:
2525
"""Interface class for meshtastic devices

meshtastic/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import logging
55
import base64
66
from google.protobuf.json_format import MessageToJson
7-
from . import portnums_pb2, apponly_pb2, admin_pb2, channel_pb2
8-
from .util import pskToString, stripnl, Timeout, our_exit, fromPSK
7+
from meshtastic import portnums_pb2, apponly_pb2, admin_pb2, channel_pb2
8+
from meshtastic.util import pskToString, stripnl, Timeout, our_exit, fromPSK
99

1010

1111

meshtastic/remote_hardware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"""
33
import logging
44
from pubsub import pub
5-
from . import portnums_pb2, remote_hardware_pb2
6-
from .util import our_exit
5+
from meshtastic import portnums_pb2, remote_hardware_pb2
6+
from meshtastic.util import our_exit
77

88

99
def onGPIOreceive(packet, interface):

meshtastic/serial_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import serial
77

88
import meshtastic.util
9-
from .stream_interface import StreamInterface
9+
from meshtastic.stream_interface import StreamInterface
1010

1111
if platform.system() != 'Windows':
1212
import termios

meshtastic/stream_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import serial
88

99

10-
from .mesh_interface import MeshInterface
11-
from .util import stripnl
10+
from meshtastic.mesh_interface import MeshInterface
11+
from meshtastic.util import stripnl
1212

1313

1414
START1 = 0x94

meshtastic/tcp_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import socket
55
from typing import AnyStr
66

7-
from .stream_interface import StreamInterface
7+
from meshtastic.stream_interface import StreamInterface
88

99
class TCPInterface(StreamInterface):
1010
"""Interface class for meshtastic devices over a TCP link"""

0 commit comments

Comments
 (0)