mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
Add support for Django 5 (#120)
This commit is contained in:
27
.github/workflows/test.yml
vendored
27
.github/workflows/test.yml
vendored
@@ -11,8 +11,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
|
||||
django: [ "3.2", "4.1", "4.2" ]
|
||||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12.0-rc.3" ]
|
||||
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:
|
||||
disque:
|
||||
@@ -39,16 +56,16 @@ jobs:
|
||||
- 6379:6379
|
||||
options: --entrypoint redis-server
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies with Django ${{ matrix.django }}
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install poetry
|
||||
poetry add "django==${{ matrix.django }}"
|
||||
poetry add "django==${{ matrix.django }}" --python=${{ matrix.python-version }}
|
||||
poetry install -E testing
|
||||
- name: Run Tests
|
||||
run: |
|
||||
|
||||
@@ -27,7 +27,7 @@ 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 tests for Django 4.x and 5.x
|
||||
- Added Turkish language
|
||||
- Improved admin area
|
||||
- Fixed a lot of issues
|
||||
@@ -40,7 +40,7 @@ Requirements
|
||||
- `Django <https://www.djangoproject.com>`__ > = 3.2
|
||||
- `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
|
||||
~~~~~~~
|
||||
|
||||
@@ -2,16 +2,18 @@ import datetime
|
||||
import time
|
||||
import zlib
|
||||
|
||||
import django
|
||||
from django.core.signing import BadSignature, JSONSerializer, SignatureExpired
|
||||
from django.core.signing import Signer as Sgnr
|
||||
from django.core.signing import TimestampSigner as TsS
|
||||
from django.core.signing import b64_decode, dumps
|
||||
|
||||
try:
|
||||
from django.core.signing import base62
|
||||
except ImportError:
|
||||
# For django < 4.0
|
||||
if django.VERSION < (5, 0):
|
||||
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.encoding import force_bytes, force_str
|
||||
|
||||
@@ -76,7 +78,7 @@ class TimestampSigner(Signer, TsS):
|
||||
"""
|
||||
result = super(TimestampSigner, self).unsign(value)
|
||||
value, timestamp = result.rsplit(self.sep, 1)
|
||||
timestamp = base62.decode(timestamp)
|
||||
timestamp = b62_decode(timestamp)
|
||||
if max_age is not None:
|
||||
if isinstance(max_age, datetime.timedelta):
|
||||
max_age = max_age.total_seconds()
|
||||
|
||||
@@ -60,7 +60,7 @@ def get_func_repr(func):
|
||||
def localtime(value=None) -> datetime:
|
||||
"""Override for timezone.localtime to deal with naive times and local times"""
|
||||
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
|
||||
|
||||
convert_to_tz = pytz.timezone(Conf.TIME_ZONE)
|
||||
|
||||
@@ -27,7 +27,7 @@ Features
|
||||
- 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.
|
||||
|
||||
|
||||
@@ -43,12 +43,12 @@ Then migrate the database to get the latest tables/fields::
|
||||
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 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>`__
|
||||
|
||||
@@ -145,7 +145,7 @@ Other known issues are:
|
||||
|
||||
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>`__
|
||||
|
||||
Open-source packages
|
||||
@@ -156,7 +156,7 @@ You can reference the `requirements <https://github.com/GDay/django-q2/blob/mast
|
||||
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.
|
||||
|
||||
1751
poetry.lock
generated
1751
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@ classifiers = [
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Programming Language :: Python :: 3.12',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
'Topic :: System :: Distributed Computing',
|
||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||
@@ -44,8 +45,11 @@ include = ['CHANGELOG.md']
|
||||
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8, <4"
|
||||
django = ">=3.2"
|
||||
python = ">=3.8,<4"
|
||||
django = [
|
||||
{ version = ">=3.2, <5", python = ">= 3.8" },
|
||||
{ version = "^5.0a1", python = ">= 3.10", allow-prereleases = true }
|
||||
]
|
||||
django-picklefield = "^3.1"
|
||||
|
||||
blessed = { version = "^1.19.1", optional = true }
|
||||
@@ -55,7 +59,7 @@ django-redis = { version = "^5.2.0", optional = true }
|
||||
iron-mq = { version = "^0.9", optional = true }
|
||||
boto3 = { version = "^1.24.92", 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-sentry = {version = ">=0.1", optional = true}
|
||||
redis = {version = "^4.3.4", optional = true}
|
||||
|
||||
Reference in New Issue
Block a user