Skip to content

Commit

Permalink
Merge pull request #2628 from sopel-irc/python-3.13
Browse files Browse the repository at this point in the history
ci, contrib, dice, meta: enable testing on Python 3.13 + fix warnings
  • Loading branch information
dgw authored Oct 11, 2024
2 parents 1c6aeb9 + ffc7916 commit dcb9eec
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 5 additions & 3 deletions contrib/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
package_root = .
min_version = 4.3.3
envlist =
py{38,39,310,311,312}-qa
py{38,39,310,311,312,313}-qa
skip_missing_interpreters = true
ignore_base_python_conflict = true
labels =
lint = py{38,39,310,311,312}-lint
test = py{38,39,310,311,312}-test
lint = py{38,39,310,311,312,313}-lint
test = py{38,39,310,311,312,313}-test


[testenv]
Expand All @@ -21,12 +21,14 @@ envname =
py310: py310
py311: py311
py312: py312
py313: py313
envdir =
py38: {toxinidir}/.tox/py38
py39: {toxinidir}/.tox/py39
py310: {toxinidir}/.tox/py310
py311: {toxinidir}/.tox/py311
py312: {toxinidir}/.tox/py312
py313: {toxinidir}/.tox/py313
depends =
base
deps =
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Communications :: Chat :: Internet Relay Chat",
]
requires-python = ">=3.8"
Expand Down
4 changes: 3 additions & 1 deletion sopel/builtins/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def roll(bot: SopelWrapper, trigger: Trigger):

arg_str_raw = trigger.group(2).split("#", 1)[0].strip()
arg_str = arg_str_raw.replace("%", "%%")
arg_str = re.sub(dice_regexp, "%s", arg_str, 0, re.IGNORECASE | re.VERBOSE)
arg_str = re.sub(
dice_regexp, "%s", arg_str,
flags=re.IGNORECASE | re.VERBOSE)

dice_expressions = [
match for match in
Expand Down
5 changes: 4 additions & 1 deletion sopel/builtins/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ def process_urls(
except ValueError:
# Extra try/except here in case the DNS resolution fails, see #2348
try:
ips = [ip_address(ip) for ip in dns.resolver.resolve(parsed_url.hostname)]
ips = [
ip_address(ip.to_text())
for ip in dns.resolver.resolve(parsed_url.hostname)
]
except Exception as exc:
LOGGER.debug(
"Cannot resolve hostname %s, ignoring URL %s"
Expand Down

0 comments on commit dcb9eec

Please sign in to comment.