diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c2a216..fbef003 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,20 +9,16 @@ jobs: strategy: matrix: - python: ["3.8", "3.9", "3.10", "3.11", "3.12"] - django: ["3.2", "4.0", "4.1", "4.2", "5.0"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] + django: ["4.2", "5.0", "5.1"] exclude: - - python: "3.11" - django: "3.2" - - python: "3.12" - django: "3.2" - - python: "3.11" - django: "4.0" - - python: "3.12" - django: "4.0" - - python: "3.8" + - python: "3.9" django: "5.0" - python: "3.9" + django: "5.1" + - python: "3.13" + django: "4.2" + - python: "3.13" django: "5.0" database_url: - postgres://runner:password@localhost/project @@ -45,19 +41,19 @@ jobs: steps: - name: Start MySQL run: sudo systemctl start mysql.service - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install system Python build deps for psycopg2 - run: sudo apt-get install python3-dev python3.11-dev + run: sudo apt-get install python3-dev - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.python }}.* - name: Upgraded pip run: pip install --upgrade pip - name: Install dependencies run: pip install -r test-requirements.txt - name: Install Django - run: pip install -U django==${{ matrix.django }} + run: pip install -U django~=${{ matrix.django }}.0 - name: Run tests run: python manage.py test - name: Run black diff --git a/README.md b/README.md index c4e698a..d589707 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Simple database-backed job queue. Jobs are defined in your settings, and are pro Asynchronous tasks are run via a *job queue*. This system is designed to support multi-step job workflows. Supported and tested against: -- Django 3.2, 4.0, 4.1, 4.2, 5.0 -- Python 3.8, 3.9, 3.10, 3.11, 3.12 +- Django 4.2, 5.0, 5.1 +- Python 3.9, 3.10, 3.11, 3.12, 3.13 ## Getting Started diff --git a/django_dbq/tests.py b/django_dbq/tests.py index dd83540..f755666 100644 --- a/django_dbq/tests.py +++ b/django_dbq/tests.py @@ -1,8 +1,8 @@ -from datetime import datetime, timedelta -import mock +from datetime import datetime, timedelta, timezone as datetime_timezone +from unittest import mock import freezegun -from django.core.management import call_command, CommandError +from django.core.management import call_command from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone @@ -13,14 +13,6 @@ from io import StringIO -try: - utc = timezone.utc -except AttributeError: - from datetime import timezone as datetime_timezone - - utc = datetime_timezone.utc - - def test_task(job=None): pass # pragma: no cover @@ -253,7 +245,8 @@ def test_gets_jobs_in_priority_and_date_order(self): def test_ignores_jobs_until_run_after_is_in_the_past(self): job_1 = Job.objects.create(name="testjob") job_2 = Job.objects.create( - name="testjob", run_after=datetime(2021, 11, 4, 8, tzinfo=utc) + name="testjob", + run_after=datetime(2021, 11, 4, 8, tzinfo=datetime_timezone.utc), ) with freezegun.freeze_time(datetime(2021, 11, 4, 7)): diff --git a/setup.py b/setup.py index 5bb0f76..fda66ff 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ author_email = "contact@dabapps.com" license = "BSD" install_requires = [ - "Django>=3.1", + "Django>=4.2", ] long_description = """Simple database-backed job queue system""" @@ -82,5 +82,5 @@ def get_package_data(package): package_data=get_package_data(package), install_requires=install_requires, classifiers=[], - python_requires=">=3.6" + python_requires=">=3.9" ) diff --git a/test-requirements.txt b/test-requirements.txt index f5b2998..93545b8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,5 @@ -mysqlclient==1.4.6 -freezegun==0.3.12 -mock==3.0.5 -dj-database-url==0.5.0 -psycopg2==2.9.5 -black==24.3.0 +mysqlclient==2.2.7 +freezegun==1.5.1 +dj-database-url==2.3.0 +psycopg2==2.9.10 +black==24.10.0