Skip to content

Commit

Permalink
- Dropped support for Python 3.7 (aiomqtt 2.x supports only 3.8+) and
Browse files Browse the repository at this point in the history
  added Python 3.11 - 3.12
  • Loading branch information
hostcc committed May 15, 2024
1 parent 3adc23f commit fddff77
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: 3.7
toxenv: py
- os: ubuntu-latest
python: 3.8
toxenv: py
Expand All @@ -32,6 +29,9 @@ jobs:
- os: ubuntu-latest
python: '3.11'
toxenv: py
- os: ubuntu-latest
python: '3.12'
toxenv: py
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.package-version.outputs.VALUE }}
Expand Down
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ classifiers =
Topic :: System :: Hardware
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3 :: Only

[options]
package_dir =
= src
packages = find:
python_requires = >=3.7
python_requires = >=3.8
install_requires =
iec62056-21 @ git+https://github.com/hostcc/iec62056-21.git@feature/transport-improvements
addict==2.4.0
aiomqtt==2.1.0;python_version>"3.7"
aiomqtt==1.1.0;python_version=="3.7"
aiomqtt==2.1.0
pyyaml==6.0.1
schema==0.7.7
python-dateutil==2.9.0
Expand Down
16 changes: 3 additions & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
import pytest
import iec62056_21.transports
from energomera_hass_mqtt.mqtt_client import MqttClient
try:
from unittest.mock import AsyncMock
except ImportError:
# AsyncMock introduced in Python 3.8, import from alternative package if
# older
from mock import AsyncMock
from unittest.mock import AsyncMock


SERIAL_EXCHANGE_COMPLETE = [
Expand Down Expand Up @@ -1046,11 +1041,6 @@ def mock_mqtt():
'''
# Mock the calls we interested in
with patch.multiple(MqttClient,
publish=DEFAULT, connect=DEFAULT,
publish=DEFAULT, connect=DEFAULT, will_set=DEFAULT,
new_callable=AsyncMock) as mocks:
# Python 3.7 can't properly distinguish between regular and async calls
# using `MagicMock` or `AsyncMock` respectively, so patch the regular
# method separately
with patch.object(MqttClient, 'will_set') as will_mock:
mocks.update({'will_set': will_mock})
yield mocks
yield mocks
18 changes: 6 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{37,38,39,310,311}
envlist = py{38,39,310,311,312}

# Define the minimal tox version required to run;
# if the host tox is less than this the tool with create an environment and
Expand All @@ -15,17 +15,11 @@ isolated_build = true
[testenv]
deps =
check-manifest==0.49
flake8==5.0.4;python_version=="3.7"
flake8==7.0.0;python_version>"3.7"
pylint==2.15.9;python_version=="3.7"
pylint==3.2.0;python_version>"3.7"
pytest==7.2.0;python_version=="3.7"
pytest==8.2.0;python_version>"3.7"
pytest-asyncio==0.20.3;python_version=="3.7"
pytest-asyncio==0.23.6;python_version>"3.7"
pytest-cov==4.0.0;python_version=="3.7"
pytest-cov==5.0.0;python_version>"3.7"
mock==4.0.3;python_version<"3.8"
flake8==7.0.0
pylint==3.2.0
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-cov==5.0.0
freezegun==1.5.1
setenv =
# Ensure the module under test will be found under `src/` directory, in
Expand Down

0 comments on commit fddff77

Please sign in to comment.