Skip to content

Commit 13d197d

Browse files
authored
update requirements and dependencies (#69)
* update requirements * baseline CI off Python 3.10 * update callbacks
1 parent da09fd4 commit 13d197d

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

.github/workflows/debian.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/setup-python@v3
1414
name: setup Python
1515
with:
16-
python-version: 3.8
16+
python-version: '3.10'
1717
- name: Checkout pywis-pubsub
1818
uses: actions/checkout@master
1919
- name: build Debian package 🏗️

.github/workflows/flake8.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-python@v3
1212
name: setup Python
1313
with:
14-
python-version: 3.8
14+
python-version: '3.10'
1515
- name: Checkout pywis-pubsub
1616
uses: actions/checkout@master
1717
- name: Install flake8

.github/workflows/test-publish-subscribe-download.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-python@v3
1212
name: setup Python
1313
with:
14-
python-version: 3.8
14+
python-version: '3.10'
1515
- name: Install pywis-pubsub
1616
run: |
1717
python3 setup.py install

pywis_pubsub/mqtt.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def __init__(self, broker: str, options: dict = {}) -> None:
6363

6464
msg = f'Connecting to broker {self.broker_safe_url} with id {self.client_id}' # noqa
6565
LOGGER.debug(msg)
66-
self.conn = mqtt_client.Client(self.client_id,
66+
self.conn = mqtt_client.Client(mqtt_client.CallbackAPIVersion.VERSION2,
67+
self.client_id,
6768
userdata=self.userdata,
6869
transport=transport)
6970

@@ -141,15 +142,16 @@ def sub(self, topics: list, qos: int = 1) -> None:
141142
:returns: `None`
142143
"""
143144

144-
def on_connect(client, userdata, flags, rc):
145+
def on_connect(client, userdata, flags, reason_code, properties):
145146
LOGGER.debug(f'Connected to broker {self.broker_safe_url}')
146147
LOGGER.debug(f'Subscribing to topics {topics}')
147148
for topic in topics:
148149
client.subscribe(topic, qos=qos)
149150
LOGGER.debug(f'Subscribed to topic {topic}, qos {qos}')
150151

151-
def on_disconnect(client, userdata, rc):
152-
LOGGER.debug(f'Disconnected from {self.broker_safe_url}: ({rc})')
152+
def on_disconnect(client, userdata, flags, reason_code, properties):
153+
msg = f'Disconnected from {self.broker_safe_url}: ({reason_code})'
154+
LOGGER.debug(msg)
153155

154156
LOGGER.debug(f'Subscribing to broker {self.broker_safe_url}, topic(s) {topics}') # noqa
155157
self.conn.on_connect = on_connect

requirements.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
boto3
22
click
33
jsonschema
4-
paho-mqtt<2
4+
paho-mqtt
55
pyyaml
66
requests
7-
shapely<2
8-
urllib3<2
7+
shapely

0 commit comments

Comments
 (0)