Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [ '3.8', '3.9', '3.10', '3.11' ]
python: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]

services:
redis:
Expand All @@ -67,7 +67,12 @@ jobs:
run: |
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get -qq update
sudo apt-get install -y python${{ matrix.python }} python${{ matrix.python }}-distutils
sudo apt-get install -y python${{ matrix.python }}
# distutils was removed from the stdlib in Python 3.12, so the
# python3.X-distutils package only exists for older versions.
if dpkg --compare-versions "${{ matrix.python }}" lt "3.12"; then
sudo apt-get install -y python${{ matrix.python }}-distutils
fi
sudo pip install autopep8 || true
- name: Run Python tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python_files := find . -path '*/.*' -prune -o -name '*.py' -print0
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
python_version_major := $(word 1,${python_version_full})

TOX_ENV ?= py37,py38,py39,py310,py311
TOX_ENV ?= py310,py311,py312,py313,py314

all: test

Expand Down
13 changes: 11 additions & 2 deletions python/ciqueue/_pytest/test_queue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from distutils import util # pylint: disable=no-name-in-module, import-modules-only
from future.moves.urllib import parse as urlparse
import ciqueue
import ciqueue.distributed
Expand All @@ -14,6 +13,16 @@ def key_item(item):
return item.nodeid


def strtobool(value):
# Replacement for distutils.util.strtobool, removed in Python 3.12.
value = value.lower()
if value in ('y', 'yes', 't', 'true', 'on', '1'):
return True
if value in ('n', 'no', 'f', 'false', 'off', '0'):
return False
raise ValueError("invalid truth value {!r}".format(value))


def parse_worker_args(query_string, tests_index):
args = urlparse.parse_qs(query_string)

Expand Down Expand Up @@ -51,7 +60,7 @@ def parse_redis_args(spec):
if 'socket_connect_timeout' in query:
result['socket_connect_timeout'] = int(query['socket_connect_timeout'][0])
if 'retry_on_timeout' in query:
result['retry_on_timeout'] = bool(util.strtobool(query['retry_on_timeout'][0] or 'false'))
result['retry_on_timeout'] = strtobool(query['retry_on_timeout'][0] or 'false')
if spec.scheme == "rediss":
result['ssl'] = True

Expand Down
2 changes: 1 addition & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox:tox]
envlist = py37,py38,py39,py310,py311
envlist = py310,py311,py312,py313,py314

[testenv]
commands = pytest {posargs:-vv}
Expand Down
1 change: 1 addition & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def get_lua_scripts():
name='ciqueue',
version='0.1',
packages=['ciqueue', 'ciqueue._pytest'],
python_requires='>=3.10',
install_requires=[
'dill>=0.2.7',
'pytest>=2.7',
Expand Down
Loading