Add support for python 3.13 and 3.14 (#338)

* update matrix

* add support for 3.14
This commit is contained in:
Stan Triepels
2026-08-02 03:46:04 +02:00
committed by GitHub
parent ea839ab664
commit fc81787612
5 changed files with 29 additions and 353 deletions
+9 -2
View File
@@ -1,4 +1,5 @@
# Standard
import multiprocessing
import os
import signal
import socket
@@ -39,6 +40,10 @@ from django_q.status import Stat, Status
from django_q.worker import worker
def get_mp_context():
return multiprocessing.get_context("fork")
class Cluster:
def __init__(self, broker: Broker = None):
# Cluster do not need an init or default broker except for testing,
@@ -60,7 +65,7 @@ class Cluster:
# Start Sentinel
self.stop_event = Event()
self.start_event = Event()
self.sentinel = Process(
self.sentinel = get_mp_context().Process(
target=Sentinel,
name=f"Process-{uuid.uuid4().hex}",
args=(
@@ -213,7 +218,9 @@ class Sentinel:
"""
:type target: function or class
"""
p = Process(target=target, args=args, name=f"Process-{uuid.uuid4().hex}")
p = get_mp_context().Process(
target=target, args=args, name=f"Process-{uuid.uuid4().hex}"
)
p.daemon = True
if target == worker:
p.daemon = Conf.DAEMONIZE_WORKERS