Skip to content

Commit d58d6a7

Browse files
authored
Merge pull request #2500 from sopel-irc/rm-py3.7
build, meta: drop Python 3.7 support, checks, and CI job
2 parents 271b306 + 2a6d146 commit d58d6a7

File tree

14 files changed

+80
-81
lines changed

14 files changed

+80
-81
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
strategy:
2121
matrix:
2222
python-version:
23-
- "3.7"
2423
- "3.8"
2524
- "3.9"
2625
- "3.10"

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ First, either clone the repository with ``git clone
3131
https://github.com/sopel-irc/sopel.git`` or download a tarball `from GitHub
3232
<https://github.com/sopel-irc/sopel/releases/latest>`_.
3333

34-
Note: Sopel requires Python 3.7+ to run.
34+
Note: Sopel requires Python 3.8+ to run.
3535

3636
In the source directory (whether cloned or from the tarball) run ``pip install
3737
-e .``. You can then run ``sopel`` to configure and start the bot.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ classifiers = [
3535
"License :: Eiffel Forum License (EFL)",
3636
"License :: OSI Approved :: Eiffel Forum License",
3737
"Operating System :: POSIX :: Linux",
38-
"Programming Language :: Python :: 3.7",
3938
"Programming Language :: Python :: 3.8",
4039
"Programming Language :: Python :: 3.9",
4140
"Programming Language :: Python :: 3.10",
4241
"Programming Language :: Python :: 3.11",
4342
"Topic :: Communications :: Chat :: Internet Relay Chat",
4443
]
45-
requires-python = ">=3.7"
44+
requires-python = ">=3.8"
4645
dependencies = [
4746
"xmltodict>=0.12,<0.14",
4847
"pytz",

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ignore =
1616
# Sopel no longer supports Python versions that require them.
1717
FI58,
1818
# These would require future imports that are not needed any more on Sopel's
19-
# oldest supported Python version (3.7).
19+
# oldest supported Python version (3.8).
2020
FI10,FI11,FI12,FI13,FI14,FI15,FI16,FI17,
2121
# We use postponed annotation evaluation
2222
TC2,

sopel/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
from __future__ import annotations
1414

1515
from collections import namedtuple
16+
import importlib.metadata
1617
import locale
1718
import re
1819
import sys
1920

20-
# TODO: replace with stdlib importlib.metadata when dropping py3.7
21-
# version info used in this module works from py3.8+
22-
import importlib_metadata
2321

2422
__all__ = [
2523
'bot',
@@ -43,7 +41,7 @@
4341
'something like "en_US.UTF-8".', file=sys.stderr)
4442

4543

46-
__version__ = importlib_metadata.version('sopel')
44+
__version__ = importlib.metadata.version('sopel')
4745

4846

4947
def _version_info(version=__version__):

sopel/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,8 +1255,8 @@ def search_url_callbacks(self, url):
12551255
The Python documentation for the `re.search`__ function and
12561256
the `match object`__.
12571257
1258-
.. __: https://docs.python.org/3.7/library/re.html#re.search
1259-
.. __: https://docs.python.org/3.7/library/re.html#match-objects
1258+
.. __: https://docs.python.org/3.11/library/re.html#re.search
1259+
.. __: https://docs.python.org/3.11/library/re.html#match-objects
12601260
12611261
"""
12621262
for regex, function in self._url_callbacks.items():

sopel/cli/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
# This is in case someone somehow manages to install Sopel on an old version
2323
# of pip (<9.0.0), which doesn't know about `python_requires`, or tries to run
2424
# from source on an unsupported version of Python.
25-
if sys.version_info < (3, 7):
26-
utils.stderr('Error: Sopel requires Python 3.7+.')
25+
if sys.version_info < (3, 8):
26+
utils.stderr('Error: Sopel requires Python 3.8+.')
2727
sys.exit(1)
2828

2929
LOGGER = logging.getLogger(__name__)

sopel/irc/isupport.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# Licensed under the Eiffel Forum License 2.
1414
from __future__ import annotations
1515

16-
from collections import OrderedDict
1716
import functools
1817
import itertools
1918
import re
@@ -392,10 +391,7 @@ def PREFIX(self) -> dict[str, str]:
392391
if 'PREFIX' not in self:
393392
raise AttributeError('PREFIX')
394393

395-
# This can use a normal dict once we drop python 3.6, as 3.7 promises
396-
# `dict` maintains insertion order. Since `OrderedDict` subclasses
397-
# `dict`, we'll not promise to always return the former.
398-
return OrderedDict(self['PREFIX'])
394+
return dict(self['PREFIX'])
399395

400396
@property
401397
def TARGMAX(self):

sopel/modules/announce.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ def _chunks(items, size):
2525
# This approach is safer than slicing with non-subscriptable types,
2626
# for example `dict_keys` objects
2727
iterator = iter(items)
28-
# TODO: Simplify to assignment expression (`while cond := expr`)
29-
# when dropping Python 3.7
30-
chunk = tuple(itertools.islice(iterator, size))
31-
while chunk:
28+
while (chunk := tuple(itertools.islice(iterator, size))):
3229
yield chunk
33-
chunk = tuple(itertools.islice(iterator, size))
3430

3531

3632
@plugin.command('announce')

sopel/modules/tld.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from datetime import datetime
1212
from encodings import idna
1313
from html.parser import HTMLParser
14+
from json import JSONDecodeError
1415
import logging
1516
import re
1617
from typing import Union
@@ -271,8 +272,7 @@ def _update_tld_data(bot, which, force=False):
271272
params=parameters,
272273
).json()
273274
data_pages.append(tld_response["parse"]["text"])
274-
# py <3.5 needs ValueError instead of more specific json.decoder.JSONDecodeError
275-
except (requests.exceptions.RequestException, ValueError, KeyError):
275+
except (requests.exceptions.RequestException, JSONDecodeError, KeyError):
276276
# Log error and continue life; it'll be fine
277277
LOGGER.warning(
278278
'Error fetching TLD data from "%s" on Wikipedia; will try again later.',

0 commit comments

Comments
 (0)