mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 21:47:53 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1764c5c8ae | ||
|
|
f0cb10bc37 | ||
|
|
167c348509 | ||
|
|
6f19b3d270 | ||
|
|
f62bd7b6b4 | ||
|
|
19d434ed4f |
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ "3.8", "3.9", "3.10" ]
|
||||
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
|
||||
django: [ "3.2", "4.1" ]
|
||||
|
||||
services:
|
||||
|
||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -1,8 +1,48 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased](https://github.com/koed00/django-q/tree/HEAD)
|
||||
## [Unreleased](https://github.com/GDay/django-q2/tree/HEAD)
|
||||
|
||||
[Full Changelog](https://github.com/koed00/django-q/compare/v1.3.9...HEAD)
|
||||
|
||||
## [v1.4.3](https://github.com/GDay/django-q2/tree/v1.4.3) (2022-11-07)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix: func reference in admin https://github.com/GDay/django-q2/pull/28
|
||||
- Add python 3.11 support and remove 3.7 (as it was never supported by this package anyway)
|
||||
|
||||
|
||||
## [v1.4.2](https://github.com/GDay/django-q2/tree/v1.4.2) (2022-10-22)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Make redis dependency optional and update boto3 #22
|
||||
|
||||
## [v1.4.1](https://github.com/GDay/django-q2/tree/v1.4.1) (2022-10-21)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix typo configure.rst https://github.com/GDay/django-q2/pull/1
|
||||
- Update dependencies https://github.com/GDay/django-q2/pull/2
|
||||
- Show function name in log when running task https://github.com/GDay/django-q2/pull/3
|
||||
- Codecov -> Coveralls https://github.com/GDay/django-q2/pull/4
|
||||
- Fix: readthedocs config file https://github.com/GDay/django-q2/pull/5
|
||||
- Docs updates https://github.com/GDay/django-q2/pull/6
|
||||
- Feat: Release plan to pypi https://github.com/GDay/django-q2/pull/7
|
||||
- Feat: Turkish translations https://github.com/GDay/django-q2/pull/8
|
||||
- Fix: Connection issues with CONN_MAX_AGE > 0 https://github.com/GDay/django-q2/pull/9
|
||||
- Replace use of eval() by ast.parse() + ast.literal_eval() https://github.com/GDay/django-q2/pull/10
|
||||
- Admin improvements https://github.com/GDay/django-q2/pull/11
|
||||
- Save limit per group/func/name https://github.com/GDay/django-q2/pull/12
|
||||
- Use logger.hasHandlers() to setup fallback logging https://github.com/GDay/django-q2/pull/13
|
||||
- allow atomic on external db https://github.com/GDay/django-q2/pull/14
|
||||
- Fix install command and remove old warnings https://github.com/GDay/django-q2/pull/16
|
||||
- Remove arrow dependency https://github.com/GDay/django-q2/pull/17
|
||||
- Remove funding file, add docker/compose for development project and fix https://github.com/GDay/django-q2/pull/18
|
||||
- Fix unclear error when function is not called correctly https://github.com/GDay/django-q2/pull/19
|
||||
- Remove blessed dependency https://github.com/GDay/django-q2/pull/20
|
||||
- Release new version and docs fixes https://github.com/GDay/django-q2/pull/21
|
||||
|
||||
## v1.4.0
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
|
||||
14
README.rst
14
README.rst
@@ -22,13 +22,25 @@ Features
|
||||
- Redis, IronMQ, SQS, MongoDB or ORM
|
||||
- Rollbar and Sentry support
|
||||
|
||||
Changes compared to the original Django-Q:
|
||||
|
||||
- Dropped support for Disque (hasn't been updated in a long time)
|
||||
- Dropped Redis, Arrow and Blessed dependencies
|
||||
- Updated all current dependencies
|
||||
- Added tests for Django 4.x
|
||||
- Added Turkish language
|
||||
- Improved admin area
|
||||
- Fixed a lot of issues
|
||||
|
||||
See the `changelog <https://github.com/GDay/django-q2/blob/master/CHANGELOG.md>`__ for all changes.
|
||||
|
||||
Requirements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- `Django <https://www.djangoproject.com>`__ > = 3.2
|
||||
- `Django-picklefield <https://github.com/gintas/django-picklefield>`__
|
||||
|
||||
Tested with: Python 3.7, 3.8, 3.9, 3.10 Django 3.2.X and 4.1.X
|
||||
Tested with: Python 3.8, 3.9, 3.10, 3.11 Django 3.2.X and 4.1.X
|
||||
|
||||
Brokers
|
||||
~~~~~~~
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Standard
|
||||
import ast
|
||||
import inspect
|
||||
import pydoc
|
||||
import signal
|
||||
import socket
|
||||
@@ -44,7 +43,7 @@ from django_q.signals import post_execute, pre_execute
|
||||
from django_q.signing import BadSignature, SignedPackage
|
||||
from django_q.status import Stat, Status
|
||||
|
||||
from .utils import add_months, add_years
|
||||
from .utils import add_months, add_years, get_func_repr
|
||||
|
||||
|
||||
class Cluster:
|
||||
@@ -456,18 +455,6 @@ def worker(
|
||||
break
|
||||
logger.info(_(f"{proc_name} stopped doing work"))
|
||||
|
||||
def get_func_repr(func):
|
||||
# convert func to string
|
||||
if inspect.isfunction(func):
|
||||
return f"{func.__module__}.{func.__name__}"
|
||||
elif inspect.ismethod(func) and hasattr(func.__self__, '__name__'):
|
||||
return (
|
||||
f"{func.__self__.__module__}."
|
||||
f"{func.__self__.__name__}.{func.__name__}"
|
||||
)
|
||||
else:
|
||||
return str(func)
|
||||
|
||||
def save_task(task, broker: Broker):
|
||||
"""
|
||||
Saves the task package to Django or the cache
|
||||
|
||||
@@ -15,6 +15,7 @@ from picklefield.fields import dbsafe_decode
|
||||
# Local
|
||||
from django_q.conf import croniter
|
||||
from django_q.signing import SignedPackage
|
||||
from .utils import get_func_repr
|
||||
|
||||
|
||||
class Task(models.Model):
|
||||
@@ -241,7 +242,7 @@ class OrmQ(models.Model):
|
||||
return SignedPackage.loads(self.payload)
|
||||
|
||||
def func(self):
|
||||
return self.task()["func"]
|
||||
return get_func_repr(self.task()["func"])
|
||||
|
||||
def task_id(self):
|
||||
return self.task()["id"]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import datetime
|
||||
import inspect
|
||||
from datetime import date
|
||||
from django.utils.timezone import make_aware
|
||||
import calendar
|
||||
|
||||
# credits: https://stackoverflow.com/a/4131114
|
||||
@@ -28,3 +27,16 @@ def add_years(d, years):
|
||||
new_date = d + (date(d.year + years, 3, 1) - date(d.year, 3, 1))
|
||||
return d.replace(year=new_date.year, month=new_date.month, day=new_date.day)
|
||||
|
||||
|
||||
def get_func_repr(func):
|
||||
# convert func to string
|
||||
if inspect.isfunction(func):
|
||||
return f"{func.__module__}.{func.__name__}"
|
||||
elif inspect.ismethod(func) and hasattr(func.__self__, '__name__'):
|
||||
return (
|
||||
f"{func.__self__.__module__}."
|
||||
f"{func.__self__.__name__}.{func.__name__}"
|
||||
)
|
||||
else:
|
||||
return str(func)
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ author = 'Ilan Steemers, Stan Triepels'
|
||||
# The short X.Y version.
|
||||
version = '1.4'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '1.4.1'
|
||||
release = '1.4.3'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -27,7 +27,7 @@ Features
|
||||
- Rollbar and Sentry support
|
||||
|
||||
|
||||
Django Q2 is tested with: Python 3.7, 3.8, 3.9 and 3.10, Django 2.2.x and 3.2.x
|
||||
Django Q2 is tested with: Python 3.8, 3.9 and 3.10, 3.11, Django 3.2.x and 4.1.x
|
||||
|
||||
Currently available in English, German and French.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Installation
|
||||
|
||||
- Install the latest version with pip::
|
||||
|
||||
$ pip install django-q
|
||||
$ pip install django-q2
|
||||
|
||||
|
||||
- Add :mod:`django_q` to ``INSTALLED_APPS`` in your projects :file:`settings.py`::
|
||||
@@ -27,7 +27,7 @@ Installation
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Django Q2 is tested for Python 3.7, 3.8, 3.9 and 3.10
|
||||
Django Q2 is tested for Python 3.8, 3.9, 3.10 and 3.11
|
||||
|
||||
- `Django <https://www.djangoproject.com>`__
|
||||
|
||||
@@ -125,7 +125,7 @@ Other known issues are:
|
||||
|
||||
Python
|
||||
~~~~~~
|
||||
Current tests are performed with 3.7, 3.8, 3.9 and 3.10
|
||||
Current tests are performed with 3.8, 3.9, 3.10 and 3.11
|
||||
If you do encounter any regressions with earlier versions, please submit an issue on `github <https://github.com/GDay/django-q2>`__
|
||||
|
||||
Open-source packages
|
||||
|
||||
18
poetry.lock
generated
18
poetry.lock
generated
@@ -106,14 +106,14 @@ wcwidth = ">=0.1.4"
|
||||
|
||||
[[package]]
|
||||
name = "boto3"
|
||||
version = "1.24.94"
|
||||
version = "1.24.95"
|
||||
description = "The AWS SDK for Python"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">= 3.7"
|
||||
|
||||
[package.dependencies]
|
||||
botocore = ">=1.27.94,<1.28.0"
|
||||
botocore = ">=1.27.95,<1.28.0"
|
||||
jmespath = ">=0.7.1,<2.0.0"
|
||||
s3transfer = ">=0.6.0,<0.7.0"
|
||||
|
||||
@@ -122,7 +122,7 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]
|
||||
|
||||
[[package]]
|
||||
name = "botocore"
|
||||
version = "1.27.94"
|
||||
version = "1.27.95"
|
||||
description = "Low-level, data-driven core of boto 3."
|
||||
category = "main"
|
||||
optional = true
|
||||
@@ -956,12 +956,12 @@ build-backend = []
|
||||
requires = []
|
||||
rollbar = ["django-q-rollbar"]
|
||||
sentry = ["django-q-sentry"]
|
||||
testing = ["django-redis", "croniter", "hiredis", "psutil", "iron-mq", "boto3", "pymongo", "blessed"]
|
||||
testing = ["django-redis", "croniter", "hiredis", "psutil", "iron-mq", "boto3", "pymongo", "blessed", "redis"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = ">=3.8.14, <4"
|
||||
content-hash = "ac947d27d316a58fe8f86837360e1328a6771fa740f93841d610e26b85ce859a"
|
||||
content-hash = "a5007f22e20151981df5e8e478ceea4b7c3d1932b0c1cef14b9cec39f04bcc84"
|
||||
|
||||
[metadata.files]
|
||||
alabaster = [
|
||||
@@ -1034,12 +1034,12 @@ blessed = [
|
||||
{file = "blessed-1.19.1.tar.gz", hash = "sha256:9a0d099695bf621d4680dd6c73f6ad547f6a3442fbdbe80c4b1daa1edbc492fc"},
|
||||
]
|
||||
boto3 = [
|
||||
{file = "boto3-1.24.94-py3-none-any.whl", hash = "sha256:f13db0beb3c9fe2cc1ed0f031189f144610d2909b5874a616e77b0bd1ae3b686"},
|
||||
{file = "boto3-1.24.94.tar.gz", hash = "sha256:f4842b395d1580454756622069f4ca0408993885ecede967001d2c101201cdfa"},
|
||||
{file = "boto3-1.24.95-py3-none-any.whl", hash = "sha256:05818ed61af104f28f039592c5c54d802a0398b1f158c2d485ec86352b48033f"},
|
||||
{file = "boto3-1.24.95.tar.gz", hash = "sha256:285d29042c1684f8fc68492ddf20180d28b94aac1f19dd7161bcad3067c01314"},
|
||||
]
|
||||
botocore = [
|
||||
{file = "botocore-1.27.94-py3-none-any.whl", hash = "sha256:8237c070d2ab29fac4fbcfe9dd2e84e0ee147402e0fed3ac1629f92459c7f1d2"},
|
||||
{file = "botocore-1.27.94.tar.gz", hash = "sha256:572224608a0b7662966fc303b768e2eba61bf53bdbf314481cd9e63a0d8e1a66"},
|
||||
{file = "botocore-1.27.95-py3-none-any.whl", hash = "sha256:04ff12a8d1d0687a1f1c2dfad5b6fc9f5a81de4b639cf9c9e41fee9449680fd4"},
|
||||
{file = "botocore-1.27.95.tar.gz", hash = "sha256:0b90945aa7080179a0c4941a3809ce4df30792931e16b9b6ef3c739c4f2b7a59"},
|
||||
]
|
||||
certifi = [
|
||||
{file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "django-q2"
|
||||
version = "1.4.1"
|
||||
version = "1.4.3"
|
||||
packages = [
|
||||
{ include = "django_q" },
|
||||
]
|
||||
@@ -26,10 +26,10 @@ classifiers = [
|
||||
'Operating System :: MacOS',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
'Topic :: System :: Distributed Computing',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
@@ -50,7 +50,6 @@ django-picklefield = "^3.1"
|
||||
|
||||
blessed = { version = "^1.19.1", optional = true }
|
||||
hiredis = { version = "^2.0.0", optional = true }
|
||||
redis = { version = "^4.3.4", optional = true }
|
||||
psutil = { version = "^5.9.2", optional = true }
|
||||
django-redis = { version = "^5.2.0", optional = true }
|
||||
iron-mq = { version = "^0.9", optional = true }
|
||||
@@ -59,6 +58,7 @@ pymongo = { version = "^4.2.0", optional = true }
|
||||
croniter = { version = "^1.3.7", optional = true }
|
||||
django-q-rollbar = {version = ">=0.1", optional = true}
|
||||
django-q-sentry = {version = ">=0.1", optional = true}
|
||||
redis = {version = "^4.3.4", optional = true}
|
||||
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
@@ -72,7 +72,7 @@ isort = {extras = ["requirements_deprecated_finder"], version = "^5.10.1"}
|
||||
[tool.poetry.extras]
|
||||
requires = ["poetry_core>=1.0.0"]
|
||||
build-backend = ["poetry.core.masonry.api"]
|
||||
testing = ["django-redis", "croniter", "hiredis", "psutil", "iron-mq", "boto3", "pymongo", "blessed"]
|
||||
testing = ["django-redis", "croniter", "hiredis", "psutil", "iron-mq", "boto3", "pymongo", "blessed", "redis"]
|
||||
rollbar = ["django-q-rollbar"]
|
||||
sentry = ["django-q-sentry"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user