mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 21:47:53 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1764c5c8ae | ||
|
|
f0cb10bc37 | ||
|
|
167c348509 | ||
|
|
6f19b3d270 | ||
|
|
f62bd7b6b4 |
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.2'
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "django-q2"
|
||||
version = "1.4.2"
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user