Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-rq for openSUSE:Factory checked in at 2023-01-04 20:18:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-rq (Old) and /work/SRC/openSUSE:Factory/.python-django-rq.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-rq" Wed Jan 4 20:18:31 2023 rev:2 rq:1055950 version:2.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-rq/python-django-rq.changes 2022-10-11 18:05:39.774095776 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-rq.new.1563/python-django-rq.changes 2023-01-04 20:18:35.745630047 +0100 @@ -1,0 +2,8 @@ +Wed Jan 4 16:21:55 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to v2.6.0: + * Added --max-jobs argument to rqworker management command. + * Remove job from ScheduledJobRegistry if a scheduled job is enqueued from + admin. Thanks @robertaistleitner! + +------------------------------------------------------------------- Old: ---- django-rq-2.5.1.tar.gz New: ---- django-rq-2.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-rq.spec ++++++ --- /var/tmp/diff_new_pack.NigVx0/_old 2023-01-04 20:18:36.213632830 +0100 +++ /var/tmp/diff_new_pack.NigVx0/_new 2023-01-04 20:18:36.217632854 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-django-rq # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-django-rq -Version: 2.5.1 +Version: 2.6.0 Release: 0 Summary: Simple app that provides django integration for RQ (Redis Queue) License: MIT ++++++ django-rq-2.5.1.tar.gz -> django-rq-2.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/.github/workflows/test.yml new/django-rq-2.6.0/.github/workflows/test.yml --- old/django-rq-2.5.1/.github/workflows/test.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/django-rq-2.6.0/.github/workflows/test.yml 2022-11-05 03:01:04.000000000 +0100 @@ -0,0 +1,41 @@ +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + + build: + runs-on: ubuntu-latest + name: Python${{ matrix.python-version }}/Django${{ matrix.django-version }} + strategy: + matrix: + python-version: ["3.8.3", "3.9", "3.10"] + django-version: ["3.2.16", "4.0.8", "4.1.3"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install django==${{ matrix.django-version }} + pip install redis django-redis rq sentry-sdk + + - name: Run Test + run: | + `which django-admin` test django_rq --settings=django_rq.tests.settings --pythonpath=. \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/CHANGELOG.md new/django-rq-2.6.0/CHANGELOG.md --- old/django-rq-2.5.1/CHANGELOG.md 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/CHANGELOG.md 2022-11-05 03:01:04.000000000 +0100 @@ -1,3 +1,8 @@ +# Version 2.5.2 (2022-11-05) +* Added `--max-jobs` argument to `rqworker` management command. Thanks @arpit-goel! +* Remove job from `ScheduledJobRegistry` if a scheduled job is enqueued from admin. Thanks @robertaistleitner! +* Minor code cleanup. Thanks @reybog90! + # Version 2.5.1 (2021-11-22) * `Redis.from_url` does not accept `ssl_cert_reqs` argument for non SSL Redis URL. Thanks @barash-asenov! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/README.rst new/django-rq-2.6.0/README.rst --- old/django-rq-2.5.1/README.rst 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/README.rst 2022-11-05 03:01:04.000000000 +0100 @@ -224,12 +224,27 @@ To use a custom job class, provide ``--job-class`` flag. -Support for RQ Scheduler ------------------------- +Support for scheduled jobs +-------------------------- -If you have `RQ Scheduler <https://github.com/ui/rq-scheduler>`__ installed, -you can also use the ``get_scheduler`` function to return a ``Scheduler`` -instance for queues defined in settings.py's ``RQ_QUEUES``. For example: +With RQ 1.2.0. you can use `built-in scheduler <https://python-rq.org/docs/scheduling/>`__ +for your jobs. For example: + +.. code-block:: python + + from django_rq.queues import get_queue + queue = get_queue('default') + job = queue.enqueue_at(datetime(2020, 10, 10), func) + +If you are using built-in scheduler you have to start workers with scheduler support:: + + python manage.py rqworker --with-scheduler + + +Alternatively you can use `RQ Scheduler <https://github.com/ui/rq-scheduler>`__. +After install you can also use the ``get_scheduler`` function to return a +``Scheduler`` instance for queues defined in settings.py's ``RQ_QUEUES``. +For example: .. code-block:: python @@ -241,6 +256,7 @@ python manage.py rqscheduler + Support for django-redis and django-redis-cache ----------------------------------------------- @@ -301,6 +317,8 @@ .. image:: demo-django-rq-json-dashboard.png +Note: Statistics of scheduled jobs display jobs from `RQ built-in scheduler <https://python-rq.org/docs/scheduling/>`__, +not optional `RQ scheduler <https://github.com/rq/rq-scheduler>`__. Additionally, these statistics are also accessible from the command line. @@ -435,7 +453,7 @@ if configured. Custom worker class should inherit from ``rq.worker.Worker``. It will be used for running -all workers unless overriden by ``rqworker`` management command ``worker-class`` option. +all workers unless overridden by ``rqworker`` management command ``worker-class`` option. Testing Tip ----------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/__init__.py new/django-rq-2.6.0/django_rq/__init__.py --- old/django-rq-2.5.1/django_rq/__init__.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/__init__.py 2022-11-05 03:01:04.000000000 +0100 @@ -1,4 +1,4 @@ -VERSION = (2, 5, 1) +VERSION = (2, 6, 0) from .decorators import job from .queues import enqueue, get_connection, get_queue, get_scheduler diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/management/commands/rqenqueue.py new/django-rq-2.6.0/django_rq/management/commands/rqenqueue.py --- old/django-rq-2.5.1/django_rq/management/commands/rqenqueue.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/management/commands/rqenqueue.py 2022-11-05 03:01:04.000000000 +0100 @@ -1,7 +1,4 @@ -from distutils.version import LooseVersion - from django.core.management.base import BaseCommand -from django.utils.version import get_version from ... import get_queue @@ -18,9 +15,7 @@ help='Specify the queue [default]') parser.add_argument('--timeout', '-t', type=int, dest='timeout', help='A timeout in seconds') - - if LooseVersion(get_version()) >= LooseVersion('1.9'): - parser.add_argument('args', nargs='*') + parser.add_argument('args', nargs='*') def handle(self, *args, **options): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/management/commands/rqscheduler.py new/django-rq-2.6.0/django_rq/management/commands/rqscheduler.py --- old/django-rq-2.5.1/django_rq/management/commands/rqscheduler.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/management/commands/rqscheduler.py 2022-11-05 03:01:04.000000000 +0100 @@ -1,9 +1,7 @@ import os -from distutils.version import LooseVersion from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand -from django.utils.version import get_version from ... import get_scheduler @@ -29,9 +27,7 @@ queue (in seconds).""") parser.add_argument('--queue', dest='queue', default='default', help="Name of the queue used for scheduling.",) - - if LooseVersion(get_version()) >= LooseVersion('1.9'): - parser.add_argument('args', nargs='*') + parser.add_argument('args', nargs='*') def handle(self, *args, **options): pid = options.get('pid') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/management/commands/rqworker.py new/django-rq-2.6.0/django_rq/management/commands/rqworker.py --- old/django-rq-2.5.1/django_rq/management/commands/rqworker.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/management/commands/rqworker.py 2022-11-05 03:01:04.000000000 +0100 @@ -1,6 +1,5 @@ import os import sys -from distutils.version import LooseVersion from redis.exceptions import ConnectionError from rq import use_connection @@ -8,7 +7,6 @@ from django.core.management.base import BaseCommand from django.db import connections -from django.utils.version import get_version from ...workers import get_worker @@ -81,10 +79,10 @@ help='A path to an alternative CA bundle file in PEM-format') parser.add_argument('--sentry-debug', action='store', default=False, dest='sentry_debug', help='Turns debug mode on or off.') - - if LooseVersion(get_version()) >= LooseVersion('1.10'): - parser.add_argument('args', nargs='*', type=str, - help='The queues to work on, separated by space') + parser.add_argument('--max-jobs', action='store', default=None, dest='max_jobs', type=int, + help='Maximum number of jobs to execute') + parser.add_argument('args', nargs='*', type=str, + help='The queues to work on, separated by space') def handle(self, *args, **options): pid = options.get('pid') @@ -127,7 +125,10 @@ # Close any opened DB connection before any fork reset_db_connections() - w.work(burst=options.get('burst', False), with_scheduler=options.get('with_scheduler', False), logging_level=level) + w.work( + burst=options.get('burst', False), with_scheduler=options.get('with_scheduler', False), + logging_level=level, max_jobs=options['max_jobs'] + ) except ConnectionError as e: self.stderr.write(str(e)) sys.exit(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/templates/django_rq/jobs.html new/django-rq-2.6.0/django_rq/templates/django_rq/jobs.html --- old/django-rq-2.5.1/django_rq/templates/django_rq/jobs.html 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/templates/django_rq/jobs.html 2022-11-05 03:01:04.000000000 +0100 @@ -74,6 +74,7 @@ <th><div class = 'text'><span>Scheduled</span></div></th> {% endif %} <th><div class = 'text'><span>Enqueued</span></div></th> + <th><div class = 'text'><span>Ended</span></div></th> <th><div class = 'text'><span>Status</span></div></th> <th><div class = 'text'><span>Callable</span></div></th> {% block extra_columns %} @@ -108,6 +109,11 @@ {{ job.enqueued_at|to_localtime|date:"Y-m-d, H:i:s" }} {% endif %} </td> + <td> + {% if job.ended_at %} + {{ job.ended_at|to_localtime|date:"Y-m-d, H:i:s" }} + {% endif %} + </td> <td>{{ job.get_status }}</td> <td>{{ job|show_func_name }}</td> {% block extra_columns_values %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/templatetags/jquery_path.py new/django-rq-2.6.0/django_rq/templatetags/jquery_path.py --- old/django-rq-2.5.1/django_rq/templatetags/jquery_path.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/templatetags/jquery_path.py 2022-11-05 03:01:04.000000000 +0100 @@ -1,20 +1,9 @@ -from distutils.version import LooseVersion from django import template -from django.utils.version import get_version register = template.Library() -if LooseVersion(get_version()) >= LooseVersion('1.9'): - JQUERY_PATH = 'admin/js/vendor/jquery/jquery.js' - # `assignment_tag` is deprecated as of 1.9, `simple_tag` should be used - tag_decorator = register.simple_tag -else: - JQUERY_PATH = 'admin/js/jquery.js' - tag_decorator = register.assignment_tag - - -@tag_decorator +@register.simple_tag def get_jquery_path(): - return JQUERY_PATH + return 'admin/js/vendor/jquery/jquery.js' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/tests/fixtures.py new/django-rq-2.6.0/django_rq/tests/fixtures.py --- old/django-rq-2.5.1/django_rq/tests/fixtures.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/tests/fixtures.py 2022-11-05 03:01:04.000000000 +0100 @@ -28,3 +28,7 @@ def access_self(): return get_current_job().id + + +def failing_job(): + raise ValueError \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/tests/test_views.py new/django-rq-2.6.0/django_rq/tests/test_views.py --- old/django-rq-2.5.1/django_rq/tests/test_views.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/tests/test_views.py 2022-11-05 03:01:04.000000000 +0100 @@ -18,7 +18,7 @@ from django_rq import get_queue from django_rq.workers import get_worker -from .fixtures import access_self +from .fixtures import access_self, failing_job from .utils import get_queue_index @@ -42,12 +42,6 @@ response = self.client.get(reverse('rq_jobs', args=[queue_index])) self.assertEqual(response.context['jobs'], [job]) - # This page shouldn't fail when job.data is corrupt - queue.connection.hset(job.key, 'data', 'unpickleable data') - response = self.client.get(reverse('rq_jobs', args=[queue_index])) - self.assertEqual(response.status_code, 200) - self.assertIn('UnpicklingError', response.content.decode('utf-8')) - def test_job_details(self): """Job data is displayed properly""" queue = get_queue('default') @@ -62,7 +56,7 @@ queue.connection.hset(job.key, 'data', 'unpickleable data') response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertIn('UnpicklingError', response.content.decode()) + self.assertIn('DeserializationError', response.content.decode()) def test_job_details_on_deleted_dependency(self): """Page doesn't crash even if job.dependency has been deleted""" @@ -81,9 +75,6 @@ """ Ensure that a failed job gets requeued when rq_requeue_job is called """ - def failing_job(): - raise ValueError - queue = get_queue('default') queue_index = get_queue_index('default') job = queue.enqueue(failing_job) @@ -100,12 +91,9 @@ """ Ensure that requeuing all failed job work properly """ - def failing_job(): - raise ValueError - queue = get_queue('default') queue_index = get_queue_index('default') - job = queue.enqueue(failing_job) + queue.enqueue(failing_job) queue.enqueue(failing_job) worker = get_worker('default') worker.work(burst=True) @@ -120,9 +108,6 @@ """ Ensure that requeuing all failed job work properly """ - def failing_job(): - raise ValueError - queue = get_queue('default') queue_index = get_queue_index('default') job = queue.enqueue(failing_job) @@ -180,7 +165,7 @@ job = queue.enqueue(access_self, depends_on=previous_job) previous_job = job - # This job is deffered + # This job is deferred last_job = job self.assertEqual(last_job.get_status(), JobStatus.DEFERRED) self.assertIsNone(last_job.enqueued_at) @@ -194,9 +179,6 @@ self.assertIsNotNone(last_job.enqueued_at) def test_action_requeue_jobs(self): - def failing_job(): - raise ValueError - queue = get_queue('django_rq_test') queue_index = get_queue_index('django_rq_test') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/tests/tests.py new/django-rq-2.6.0/django_rq/tests/tests.py --- old/django-rq-2.5.1/django_rq/tests/tests.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/tests/tests.py 2022-11-05 03:01:04.000000000 +0100 @@ -224,7 +224,7 @@ self.assertEqual(queue.name, 'url_default_db') self.assertEqual(connection_kwargs['host'], 'host') self.assertEqual(connection_kwargs['port'], 1234) - self.assertEqual(connection_kwargs['db'], 0) + self.assertEqual(connection_kwargs['db'], None) self.assertEqual(connection_kwargs['password'], 'password') def test_get_queue_test(self): @@ -522,14 +522,13 @@ Checks if a worker with specified queues is created when queue names are given. """ - w = get_worker('test') + w = get_worker('test3') self.assertEqual(len(w.queues), 1) queue = w.queues[0] - self.assertEqual(queue.name, 'test') + self.assertEqual(queue.name, 'test3') def test_get_worker_custom_classes(self): - w = get_worker('test', - job_class='django_rq.tests.fixtures.DummyJob', + w = get_worker(job_class='django_rq.tests.fixtures.DummyJob', queue_class='django_rq.tests.fixtures.DummyQueue', worker_class='django_rq.tests.fixtures.DummyWorker') self.assertIs(w.job_class, DummyJob) @@ -772,12 +771,12 @@ class WorkerClassTest(TestCase): def test_default_worker_class(self): - worker = get_worker('test') + worker = get_worker() self.assertIsInstance(worker, Worker) @override_settings(RQ={'WORKER_CLASS': 'django_rq.tests.fixtures.DummyWorker'}) def test_custom_class(self): - worker = get_worker('test') + worker = get_worker() self.assertIsInstance(worker, DummyWorker) def test_local_override(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/thread_queue.py new/django-rq-2.6.0/django_rq/thread_queue.py --- old/django-rq-2.5.1/django_rq/thread_queue.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/thread_queue.py 2022-11-05 03:01:04.000000000 +0100 @@ -7,7 +7,7 @@ def get_queue(): """ Returns a temporary queue to store jobs before they're committed - later in the request/responsce cycle. Each job is stored as a tuple + later in the request/response cycle. Each job is stored as a tuple containing the queue, args and kwargs. For example, if we call ``queue.enqueue_call(foo, kwargs={'bar': 'baz'})`` during the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/django_rq/views.py new/django-rq-2.6.0/django_rq/views.py --- old/django-rq-2.5.1/django_rq/views.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/django_rq/views.py 2022-11-05 03:01:04.000000000 +0100 @@ -506,6 +506,9 @@ elif job.get_status() == JobStatus.FINISHED: registry = FinishedJobRegistry(queue.name, queue.connection) registry.remove(job) + elif job.get_status() == JobStatus.SCHEDULED: + registry = ScheduledJobRegistry(queue.name, queue.connection) + registry.remove(job) messages.info(request, 'You have successfully enqueued %s' % job.id) return redirect('rq_job_detail', queue_index, job_id) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/integration_test/README.md new/django-rq-2.6.0/integration_test/README.md --- old/django-rq-2.5.1/integration_test/README.md 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/integration_test/README.md 2022-11-05 03:01:04.000000000 +0100 @@ -1,4 +1,4 @@ -A sample project to test rqworker and site interraction +A sample project to test rqworker and site interaction ## Prerequisites diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/integration_test/requirements.txt new/django-rq-2.6.0/integration_test/requirements.txt --- old/django-rq-2.5.1/integration_test/requirements.txt 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/integration_test/requirements.txt 2022-11-05 03:01:04.000000000 +0100 @@ -1,5 +1,5 @@ -e .. -Django==3.2.9 +Django==3.2.16 gunicorn==20.1.0 -psycopg2==2.9.2 -requests==2.26.0 +psycopg2==2.9.5 +requests==2.28.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-rq-2.5.1/setup.py new/django-rq-2.6.0/setup.py --- old/django-rq-2.5.1/setup.py 2021-11-22 01:37:47.000000000 +0100 +++ new/django-rq-2.6.0/setup.py 2022-11-05 03:01:04.000000000 +0100 @@ -3,7 +3,7 @@ setup( name='django-rq', - version='2.5.1', + version='2.6.0', author='Selwin Ong', author_email='selwin....@gmail.com', packages=['django_rq'],