5 Commits

Author SHA1 Message Date
Stan Triepels
1764c5c8ae Release 1.4.3 (#32)
Update changelog and bump version number
2022-11-07 17:47:05 +01:00
Mikhail Krassavin
f0cb10bc37 Add Python 3.11 support and tests, remove Python 3.7 (#31) 2022-11-07 17:29:29 +01:00
Stan Triepels
167c348509 Update changelog and readme (#29)
Added changes from the previous versions and diff between Q and Q2
2022-11-05 23:06:34 +01:00
Stan Triepels
6f19b3d270 Fix: func reference in admin (#28) 2022-11-05 02:45:44 +01:00
Stan Triepels
f62bd7b6b4 Fix install docs: update q to q2 (#25) 2022-10-27 02:08:08 +02:00
10 changed files with 80 additions and 28 deletions

View File

@@ -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:

View File

@@ -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:**

View File

@@ -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
~~~~~~~

View File

@@ -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

View File

@@ -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"]

View File

@@ -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)

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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',