Compare commits

...
9 Commits
Author SHA1 Message Date
GDay e3be22ac63 Release v1.6.1 2023-10-13 14:15:58 +02:00
Stan Triepels 0aaeb8d35d Fix strict versions for python/django - poetry install error (#130) 2023-10-13 14:13:22 +02:00
GDay 750c654940 Release v1.6.0 2023-10-13 00:59:42 +02:00
Stan Triepels 1d2a6059db Add support for Django 5 (#120) 2023-10-12 22:44:19 +02:00
Stan Triepels 54ab399758 Fix for "apps not ready" in Windows and Mac (#116) 2023-10-09 22:04:32 +02:00
Grayknife bc50219141 Update broken MongoClient link in Docs (#127) 2023-10-07 22:15:49 +02:00
Grayknife 939d0ebef1 Fix German Translation Typo (#124) 2023-09-30 13:28:42 +02:00
Jrog 68af2ae13e Update Add-ons install command in install.rst (#115) 2023-09-14 14:37:12 +02:00
Dustin BlanchardandStan Triepels 960f72a1d0 DOCS: Correct health check import in examples.rst (#110)
* Correct health check import in examples.rst

* Update monitor.rst

---------

Co-authored-by: Stan Triepels <1939656+GDay@users.noreply.github.com>
2023-09-05 17:05:47 +02:00
20 changed files with 1012 additions and 884 deletions
+22 -5
View File
@@ -11,8 +11,25 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ] python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12.0-rc.3" ]
django: [ "3.2", "4.1", "4.2" ] django: [ "3.2", "4.1", "4.2", "5.0a1"]
exclude:
# django 5.0 does not support 3.8 and 3.9
- python-version: "3.8"
django: "5.0a1"
- python-version: "3.9"
django: "5.0a1"
# django 4.2 does not support 3.12
- python-version: "3.12.0-rc.3"
django: "4.2"
# django 4.1 does not support 3.12
- python-version: "3.12.0-rc.3"
django: "4.1"
# django 3.2 does not support 3.11 and 3.12
- python-version: "3.11"
django: "3.2"
- python-version: "3.12.0-rc.3"
django: "3.2"
services: services:
disque: disque:
@@ -39,16 +56,16 @@ jobs:
- 6379:6379 - 6379:6379
options: --entrypoint redis-server options: --entrypoint redis-server
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies with Django ${{ matrix.django }} - name: Install dependencies with Django ${{ matrix.django }}
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install poetry pip install poetry
poetry add "django==${{ matrix.django }}" poetry add "django==${{ matrix.django }}" --python=${{ matrix.python-version }}
poetry install -E testing poetry install -E testing
- name: Run Tests - name: Run Tests
run: | run: |
+16 -1
View File
@@ -1,6 +1,21 @@
# Changelog # Changelog
## [Unreleased](https://github.com/GDay/django-q2/tree/HEAD) ## [v1.6.1](https://github.com/django-q2/django-q2/tree/v1.6.1) (2023-10-13)
**Merged pull requests:**
- Fix strict versions for python/django https://github.com/django-q2/django-q2/pull/130
## [v1.6.0](https://github.com/django-q2/django-q2/tree/v1.6.0) (2023-10-12)
**Merged pull requests:**
- Add support for Django 5 and python 12 https://github.com/django-q2/django-q2/pull/120
- Fix for "apps not ready" in Windows and Mac https://github.com/django-q2/django-q2/pull/116
- Update broken MongoClient link in Docs https://github.com/django-q2/django-q2/pull/127
- Fix German Translation Typo https://github.com/django-q2/django-q2/pull/124
- Update Add-ons install command in install.rst https://github.com/django-q2/django-q2/pull/115
- DOCS: Correct health check import in examples.rst https://github.com/django-q2/django-q2/pull/110
## [v1.5.5](https://github.com/django-q2/django-q2/tree/v1.5.5) (2023-09-01) ## [v1.5.5](https://github.com/django-q2/django-q2/tree/v1.5.5) (2023-09-01)
+2 -2
View File
@@ -27,7 +27,7 @@ Changes compared to the original Django-Q:
- Dropped support for Disque (hasn't been updated in a long time) - Dropped support for Disque (hasn't been updated in a long time)
- Dropped Redis, Arrow and Blessed dependencies - Dropped Redis, Arrow and Blessed dependencies
- Updated all current dependencies - Updated all current dependencies
- Added tests for Django 4.x - Added tests for Django 4.x and 5.x
- Added Turkish language - Added Turkish language
- Improved admin area - Improved admin area
- Fixed a lot of issues - Fixed a lot of issues
@@ -40,7 +40,7 @@ Requirements
- `Django <https://www.djangoproject.com>`__ > = 3.2 - `Django <https://www.djangoproject.com>`__ > = 3.2
- `Django-picklefield <https://github.com/gintas/django-picklefield>`__ - `Django-picklefield <https://github.com/gintas/django-picklefield>`__
Tested with: Python 3.8, 3.9, 3.10 and 3.11. Works with Django 3.2.X, 4.1.X and 4.2.X. Tested with: Python 3.8, 3.9, 3.10, 3.11 and 3.12. Works with Django 3.2.X, 4.1.X, 4.2.X and 5.0.X
Brokers Brokers
~~~~~~~ ~~~~~~~
+1 -1
View File
@@ -1,6 +1,6 @@
import django import django
VERSION = (1, 5, 5) VERSION = (1, 6, 1)
if django.VERSION < (3, 2): if django.VERSION < (3, 2):
default_app_config = "django_q.apps.DjangoQConfig" default_app_config = "django_q.apps.DjangoQConfig"
+4 -10
View File
@@ -9,11 +9,6 @@ from time import sleep
from django import core, db from django import core, db
from django.apps.registry import apps from django.apps.registry import apps
from django_q.monitor import monitor
from django_q.pusher import pusher
from django_q.scheduler import scheduler
from django_q.worker import worker
try: try:
apps.check_apps_ready() apps.check_apps_ready()
except core.exceptions.AppRegistryNotReady: except core.exceptions.AppRegistryNotReady:
@@ -25,16 +20,15 @@ from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
# Local # Local
import django_q.tasks
from django_q.brokers import Broker, get_broker from django_q.brokers import Broker, get_broker
from django_q.conf import Conf, get_ppid, logger, psutil, setproctitle from django_q.conf import Conf, get_ppid, logger, psutil, setproctitle
from django_q.humanhash import humanize from django_q.humanhash import humanize
from django_q.models import Schedule, Success, Task from django_q.monitor import monitor
from django_q.pusher import pusher
from django_q.queues import Queue from django_q.queues import Queue
from django_q.signing import BadSignature, SignedPackage from django_q.scheduler import scheduler
from django_q.status import Stat, Status from django_q.status import Stat, Status
from django_q.worker import worker
from .utils import get_func_repr
class Cluster: class Cluster:
+7 -5
View File
@@ -2,16 +2,18 @@ import datetime
import time import time
import zlib import zlib
import django
from django.core.signing import BadSignature, JSONSerializer, SignatureExpired from django.core.signing import BadSignature, JSONSerializer, SignatureExpired
from django.core.signing import Signer as Sgnr from django.core.signing import Signer as Sgnr
from django.core.signing import TimestampSigner as TsS from django.core.signing import TimestampSigner as TsS
from django.core.signing import b64_decode, dumps from django.core.signing import b64_decode, dumps
try: if django.VERSION < (5, 0):
from django.core.signing import base62
except ImportError:
# For django < 4.0
from django.utils.baseconv import base62 from django.utils.baseconv import base62
b62_decode = base62.decode
else:
from django.core.signing import b62_decode
from django.utils.crypto import constant_time_compare from django.utils.crypto import constant_time_compare
from django.utils.encoding import force_bytes, force_str from django.utils.encoding import force_bytes, force_str
@@ -76,7 +78,7 @@ class TimestampSigner(Signer, TsS):
""" """
result = super(TimestampSigner, self).unsign(value) result = super(TimestampSigner, self).unsign(value)
value, timestamp = result.rsplit(self.sep, 1) value, timestamp = result.rsplit(self.sep, 1)
timestamp = base62.decode(timestamp) timestamp = b62_decode(timestamp)
if max_age is not None: if max_age is not None:
if isinstance(max_age, datetime.timedelta): if isinstance(max_age, datetime.timedelta):
max_age = max_age.total_seconds() max_age = max_age.total_seconds()
+1 -1
View File
@@ -318,7 +318,7 @@ msgstr "Anzahl Minuten für den Typ 'Minuten'"
#: models.py:205 #: models.py:205
msgid "Repeats" msgid "Repeats"
msgstr "Wiederhohlungen" msgstr "Wiederholungen"
#: models.py:205 #: models.py:205
msgid "n = n times, -1 = forever" msgid "n = n times, -1 = forever"
+12 -4
View File
@@ -1,15 +1,23 @@
from multiprocessing.process import current_process from multiprocessing.process import current_process
from multiprocessing.queues import Queue from multiprocessing.queues import Queue
from django import db from django import core, db
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.apps.registry import apps
try:
apps.check_apps_ready()
except core.exceptions.AppRegistryNotReady:
import django
django.setup()
import django_q.tasks
from django_q.brokers import Broker, get_broker from django_q.brokers import Broker, get_broker
from django_q.conf import Conf, logger, setproctitle from django_q.conf import Conf, logger, setproctitle
from django_q.models import Success, Task from django_q.models import Success, Task
from django_q.signals import post_execute from django_q.signals import post_execute
from django_q.signing import SignedPackage from django_q.signing import SignedPackage
from django_q.tasks import async_chain
from django_q.utils import close_old_django_connections, get_func_repr from django_q.utils import close_old_django_connections, get_func_repr
try: try:
@@ -77,7 +85,7 @@ def save_task(task, broker: Broker):
return return
# enqueues next in a chain # enqueues next in a chain
if task.get("chain", None): if task.get("chain", None):
django_q.tasks.async_chain( async_chain(
task["chain"], task["chain"],
group=task["group"], group=task["group"],
cached=task["cached"], cached=task["cached"],
@@ -185,7 +193,7 @@ def save_cached(task, broker: Broker):
broker.cache.set(group_key, group_list, timeout) broker.cache.set(group_key, group_list, timeout)
# async_task next in a chain # async_task next in a chain
if task.get("chain", None): if task.get("chain", None):
django_q.tasks.async_chain( async_chain(
task["chain"], task["chain"],
group=group, group=group,
cached=task["cached"], cached=task["cached"],
+9
View File
@@ -3,7 +3,16 @@ from multiprocessing.process import current_process
from multiprocessing.queues import Queue from multiprocessing.queues import Queue
from time import sleep from time import sleep
from django import core
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.apps.registry import apps
try:
apps.check_apps_ready()
except core.exceptions.AppRegistryNotReady:
import django
django.setup()
from django_q.brokers import Broker, get_broker from django_q.brokers import Broker, get_broker
from django_q.conf import Conf, logger from django_q.conf import Conf, logger
+12 -3
View File
@@ -1,15 +1,24 @@
import ast import ast
from multiprocessing.process import current_process from multiprocessing.process import current_process
from django import db from django import core, db
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
import django_q.tasks from django.apps.registry import apps
try:
apps.check_apps_ready()
except core.exceptions.AppRegistryNotReady:
import django
django.setup()
from django_q.brokers import Broker, get_broker from django_q.brokers import Broker, get_broker
from django_q.conf import Conf, logger from django_q.conf import Conf, logger
from django_q.humanhash import humanize from django_q.humanhash import humanize
from django_q.models import Schedule from django_q.models import Schedule
from django_q.tasks import async_task
from django_q.utils import close_old_django_connections, localtime from django_q.utils import close_old_django_connections, localtime
@@ -86,7 +95,7 @@ def scheduler(broker: Broker = None):
q_options["broker"] = broker q_options["broker"] = broker
q_options["group"] = q_options.get("group", s.name or s.id) q_options["group"] = q_options.get("group", s.name or s.id)
kwargs["q_options"] = q_options kwargs["q_options"] = q_options
s.task = django_q.tasks.async_task(s.func, *args, **kwargs) s.task = async_task(s.func, *args, **kwargs)
# log it # log it
if not s.task: if not s.task:
logger.error( logger.error(
+1 -1
View File
@@ -60,7 +60,7 @@ def get_func_repr(func):
def localtime(value=None) -> datetime: def localtime(value=None) -> datetime:
"""Override for timezone.localtime to deal with naive times and local times""" """Override for timezone.localtime to deal with naive times and local times"""
if settings.USE_TZ: if settings.USE_TZ:
if django.VERSION >= (4, 0) and settings.USE_DEPRECATED_PYTZ: if django.VERSION >= (4, 0) and getattr(settings, "USE_DEPRECATED_PYTZ", False):
import pytz import pytz
convert_to_tz = pytz.timezone(Conf.TIME_ZONE) convert_to_tz = pytz.timezone(Conf.TIME_ZONE)
+9
View File
@@ -4,8 +4,17 @@ from multiprocessing import Value
from multiprocessing.process import current_process from multiprocessing.process import current_process
from multiprocessing.queues import Queue from multiprocessing.queues import Queue
from django import core
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.apps.registry import apps
try:
apps.check_apps_ready()
except core.exceptions.AppRegistryNotReady:
import django
django.setup()
from django_q.conf import Conf, error_reporter, logger, resource, setproctitle from django_q.conf import Conf, error_reporter, logger, resource, setproctitle
from django_q.signals import post_spawn, pre_execute from django_q.signals import post_spawn, pre_execute
+2 -2
View File
@@ -73,9 +73,9 @@ author = "Ilan Steemers, Stan Triepels"
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = "1.5" version = "1.6"
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = "1.5.5" release = "1.6.1"
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
+1 -1
View File
@@ -348,7 +348,7 @@ To use MongoDB as a message broker you simply provide the connection information
} }
} }
The ``mongo`` dictionary can contain any of the parameters exposed by pymongo's `MongoClient <https://api.mongodb.org/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient>`__ The ``mongo`` dictionary can contain any of the parameters exposed by pymongo's `MongoClient <https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient>`__
If you want to use a mongodb uri, you can supply it as the ``host`` parameter. If you want to use a mongodb uri, you can supply it as the ``host`` parameter.
mongo_db mongo_db
+1 -1
View File
@@ -328,7 +328,7 @@ Requires cache to be enabled. Save file in your Django project's root directory
# All django stuff has to come after the setup: # All django stuff has to come after the setup:
django.setup() django.setup()
from django_q.monitor import Stat from django_q.status import Stat
from django_q.conf import Conf from django_q.conf import Conf
# Set host and port settings # Set host and port settings
+1 -1
View File
@@ -27,7 +27,7 @@ Features
- Rollbar and Sentry support - Rollbar and Sentry support
Django Q2 is tested with: Python 3.8, 3.9, 3.10 and 3.11. Works with Django 3.2.x, 4.1.x and 4.2.x Django Q2 is tested with: Python 3.8, 3.9, 3.10, 3.11 and 3.12. Works with Django 3.2.x, 4.1.x, 4.2.x and 5.0.x
Currently available in English, German and French. Currently available in English, German and French.
+7 -7
View File
@@ -43,12 +43,12 @@ Then migrate the database to get the latest tables/fields::
Requirements Requirements
------------ ------------
Django Q2 is tested for Python 3.8, 3.9, 3.10 and 3.11 Django Q2 is tested for Python 3.8, 3.9, 3.10, 3.11 and 3.12
- `Django <https://www.djangoproject.com>`__ - `Django <https://www.djangoproject.com>`__
Django Q2 aims to use as much of Django's standard offerings as possible. Django Q2 aims to use as much of Django's standard offerings as possible.
The code is tested against Django versions `3.2.x`, `4.1.x` and`4.2.x`. The code is tested against Django versions `3.2.x`, `4.1.x`, `4.2.x` and `5.0.x`.
- `Django-picklefield <https://github.com/gintas/django-picklefield>`__ - `Django-picklefield <https://github.com/gintas/django-picklefield>`__
@@ -115,11 +115,11 @@ Add-ons
------- -------
- `django-q-rollbar <https://github.com/danielwelch/django-q-rollbar>`__ is a Rollbar error reporter:: - `django-q-rollbar <https://github.com/danielwelch/django-q-rollbar>`__ is a Rollbar error reporter::
$ pip install django-q[rollbar] $ pip install django-q2[rollbar]
- `django-q-sentry <https://github.com/danielwelch/django-q-sentry>`__ is a Sentry error reporter:: - `django-q-sentry <https://github.com/danielwelch/django-q-sentry>`__ is a Sentry error reporter::
$ pip install django-q[sentry] $ pip install django-q2[sentry]
- `django-q-email <https://github.com/joeyespo/django-q-email>`__ is a compatible Django email backend that will automatically async queue your emails. - `django-q-email <https://github.com/joeyespo/django-q-email>`__ is a compatible Django email backend that will automatically async queue your emails.
@@ -145,7 +145,7 @@ Other known issues are:
Python Python
~~~~~~ ~~~~~~
Current tests are performed with 3.8, 3.9, 3.10 and 3.11 Current tests are performed with 3.8, 3.9, 3.10, 3.11 and 3.12
If you do encounter any regressions with earlier versions, please submit an issue on `github <https://github.com/GDay/django-q2>`__ If you do encounter any regressions with earlier versions, please submit an issue on `github <https://github.com/GDay/django-q2>`__
Open-source packages Open-source packages
@@ -156,7 +156,7 @@ You can reference the `requirements <https://github.com/GDay/django-q2/blob/mast
Django Django
~~~~~~ ~~~~~~
We strive to be compatible with the last two major version of Django. We strive to be compatible with the last two major version of Django.
At the moment this means we support the 3.2.x, 4.1.x and 4.2.x releases. At the moment this means we support the 3.2.x, 4.1.x, 4.2.x and 5.0.x releases.
Since we are now no longer supporting Python 2, we can also not support older versions of Django that do not support Python >= 3.6 Since we are now no longer supporting Python 2, we can also not support older versions of Django that do not support Python >= 3.8
For this you can always use older releases, but they are no longer maintained. For this you can always use older releases, but they are no longer maintained.
+1 -1
View File
@@ -111,7 +111,7 @@ You can check the status of your clusters straight from your code with the :clas
.. code:: python .. code:: python
from django_q.monitor import Stat from django_q.status import Stat
for stat in Stat.get_all(): for stat in Stat.get_all():
print(stat.cluster_id, stat.status) print(stat.cluster_id, stat.status)
Generated
+898 -834
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "django-q2" name = "django-q2"
version = "1.5.5" version = "1.6.1"
packages = [ packages = [
{ include = "django_q" }, { include = "django_q" },
] ]
@@ -30,6 +30,7 @@ classifiers = [
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP',
'Topic :: System :: Distributed Computing', 'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Python Modules',
@@ -44,8 +45,8 @@ include = ['CHANGELOG.md']
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8, <4" python = ">=3.8,<4"
django = ">=3.2" django = { version = ">=3.2, <6", allow-prereleases = true}
django-picklefield = "^3.1" django-picklefield = "^3.1"
blessed = { version = "^1.19.1", optional = true } blessed = { version = "^1.19.1", optional = true }
@@ -55,7 +56,7 @@ django-redis = { version = "^5.2.0", optional = true }
iron-mq = { version = "^0.9", optional = true } iron-mq = { version = "^0.9", optional = true }
boto3 = { version = "^1.24.92", optional = true } boto3 = { version = "^1.24.92", optional = true }
pymongo = { version = "^4.2.0", optional = true } pymongo = { version = "^4.2.0", optional = true }
croniter = { version = "^1.3.7", optional = true } croniter = { version = "^2.0.1", optional = true }
django-q-rollbar = {version = ">=0.1", optional = true} django-q-rollbar = {version = ">=0.1", optional = true}
django-q-sentry = {version = ">=0.1", optional = true} django-q-sentry = {version = ">=0.1", optional = true}
redis = {version = "^4.3.4", optional = true} redis = {version = "^4.3.4", optional = true}