Skip to content

Commit

Permalink
Avoid using removed rq.compat from rq older than rq 1.13
Browse files Browse the repository at this point in the history
rq 1.13 dropped rq.compat completed. It was replaced with a simple
__str__() instead. Bump minimum version to 1.13 which provides that new
api.
  • Loading branch information
dirkmueller committed Dec 6, 2023
1 parent 0521e7f commit 545ddaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
rqscheduler = rq_scheduler.scripts.rqscheduler:main
''',
package_data={'': ['README.rst']},
install_requires=['crontab>=0.23.0', 'rq>=0.13', 'python-dateutil', 'freezegun'],
install_requires=['crontab>=0.23.0', 'rq>=1.13', 'python-dateutil', 'freezegun'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
Expand Down
3 changes: 1 addition & 2 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from redis import Redis
from rq import Connection, get_current_job, get_current_connection, Queue
from rq.decorators import job
from rq.compat import text_type
from rq.worker import HerokuWorker, Worker


Expand All @@ -39,7 +38,7 @@ async def say_hello_async(name=None):

def say_hello_unicode(name=None):
"""A job with a single argument and a return value."""
return text_type(say_hello(name)) # noqa
return str(say_hello(name)) # noqa


def do_nothing():
Expand Down
3 changes: 1 addition & 2 deletions tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from dateutil.tz import tzlocal
from dateutil.tz import UTC
from rq import Queue
from rq.compat import as_text
from rq.job import Job

from rq_scheduler import Scheduler
Expand All @@ -28,7 +27,7 @@ def say_hello(name=None):


def tl(l):
return [as_text(i) for i in l]
return [str(i) for i in l]


def simple_addition(x, y, z):
Expand Down

0 comments on commit 545ddaa

Please sign in to comment.