10000 Drop python 3.7 support (#455) · python-kasa/python-kasa@ce5821a · GitHub
[go: up one dir, main page]

Skip to content

Commit ce5821a

Browse files
authored
Drop python 3.7 support (#455)
* Drop python 3.7 support * CI: drop 3.7 and add 3.11 * Remove skipifs that were required for <3.8 * Use pypy-3.8 for CI, re-enable pypy for windows to see if it works now * Bump readthedocs to use py3.8 * Remove py3.7 failure comment
1 parent e7b7f1d commit ce5821a

File tree

8 files changed

+8
-21
lines changed

8 files changed

+8
-21
lines changed

.github/workflows/ci.yml

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

1616
strategy:
1717
matrix:
18-
python-version: ["3.10"]
18+
python-version: ["3.11"]
1919

2020
steps:
2121
- uses: "actions/checkout@v2"
@@ -64,14 +64,14 @@ jobs:
6464

6565
strategy:
6666
matrix:
67-
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
67+
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
6868
os: [ubuntu-latest, macos-latest, windows-latest]
6969
# exclude pypy on windows, as the poetry install seems to be very flaky:
7070
# PermissionError(13, 'The process cannot access the file because it is being used by another process'))
7171
# at C:\hostedtoolcache\windows\PyPy\3.7.10\x86\site-packages\requests\models.py:761 in generate
72-
exclude:
73-
- python-version: pypy-3.7
74-
os: windows-latest
72+
# exclude:
73+
# - python-version: pypy-3.8
74+
# os: windows-latest
7575

7676
steps:
7777
- uses: "actions/checkout@v2"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
rev: v3.4.0
1414
hooks:
1515
- id: pyupgrade
16-
args: ['--py37-plus']
16+
args: ['--py38-plus']
1717

1818
- repo: https://github.com/python/black
1919
rev: 23.3.0

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ build:
22
image: latest
33

44
python:
5-
version: 3.7
5+
version: 3.8
66
pip_install: true
77
extra_requirements:
88
- docs

kasa/tests/test_cli.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ async def test_raw_command(dev):
6060
assert "Usage" in res.output
6161

6262

63-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="3.8 is first one with asyncmock")
6463
async def test_emeter(dev: SmartDevice, mocker):
6564
runner = CliRunner()
6665

@@ -103,9 +102,6 @@ async def test_brightness(dev):
103102
assert "Brightness: 12" in res.output
104103

105104

106-
# Invoke fails when run on py3.7 with the following error:
107-
# E + where 1 = <Result TypeError("object list can't be used in 'await' expression")>.exit_code
108-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="fails on python3.7")
109105
async def test_json_output(dev: SmartDevice, mocker):
110106
"""Test that the json output produces correct output."""
111107
mocker.patch("kasa.Discover.discover", return_value=[dev])

kasa/tests/test_discovery.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ async def test_type_unknown():
5252
Discover._get_device_class(invalid_info)
5353

5454

55-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="3.8 is first one with asyncmock")
5655
async def test_discover_single(discovery_data: dict, mocker):
5756
"""Make sure that discover_single returns an initialized SmartDevice instance."""
5857
mocker.patch("kasa.TPLinkSmartHomeProtocol.query", return_value=discovery_data)
@@ -71,7 +70,6 @@ async def test_discover_single(discovery_data: dict, mocker):
7170
]
7271

7372

74-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="3.8 is first one with asyncmock")
7573
@pytest.mark.parametrize("msg, data", INVALIDS)
7674
async def test_discover_invalid_info(msg, data, mocker):
7775
"""Make sure that invalid discovery information raises an exception."""

kasa/tests/test_protocol.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ async def test_protocol_retry_recoverable_error(mocker):
6262
assert conn.call_count == 6
6363

6464

65-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="3.8 is first one with asyncmock")
6665
@pytest.mark.parametrize("retry_count", [1, 3, 5])
6766
async def test_protocol_reconnect(mocker, retry_count):
6867
remaining = retry_count
@@ -98,7 +97,6 @@ def aio_mock_writer(_, __):
9897
assert response == {"great": "success"}
9998

10099

101-
@pytest.mark.skipif(sys.version_info < (3, 8), reason="3.8 is first one with asyncmock")
102100
@pytest.mark.parametrize("log_level", [logging.WARNING, logging.DEBUG])
103101
async def test_protocol_logging(mocker, caplog, log_level):
104102
caplog.set_level(log_level)

kasa/tests/test_readme_examples.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,10 @@ def test_lightstrip_examples(mocker):
6161
assert not res["failed"]
6262

6363

64-
@pytest.mark.skipif(
65-
sys.version_info < (3, 8), reason="3.7 handles asyncio.run differently"
66-
)
6764
def test_discovery_examples(mocker):
6865
"""Test discovery examples."""
6966
p = asyncio.run(get_device_for_file("KP303(UK)_1.0_1.0.3.json"))
7067

71-
# This succeeds on python 3.8 but fails on 3.7
72-
# ValueError: a coroutine was expected, got [<DeviceType.Strip model KP303(UK) ...
7368
mocker.patch("kasa.discover.Discover.discover", return_value=[p])
7469
res = xdoctest.doctest_module("kasa.discover", "all")
7570
assert not res["failed"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include = ["CHANGELOG.md"]
1919
kasa = "kasa.cli:cli"
2020

2121
[tool.poetry.dependencies]
22-
python = "^3.7"
22+
python = "^3.8"
2323
anyio = "*" # see https://github.com/python-trio/asyncclick/issues/18
2424
importlib-metadata = "*"
2525
asyncclick = ">=8"

0 commit comments

Comments
 (0)
0