diff --git a/.gitignore b/.gitignore index 5401004..5e87d24 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,6 @@ target/ # SQLite *.sqlite3 + +# Ignore Virtualenv +/venv/ diff --git a/README.md b/README.md index 54b421d..851deeb 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,16 @@ A database backed job scheduler for Django RQ. Currently, when you pip install Django RQ Scheduler the following packages are also installed. -* django >= 1.9 +* django >= 2 * django-model-utils >= 2.4 * django-rq >= 0.9.3 (Django RQ requires RQ >= 0.5.5) * rq-scheduler >= 0.6.0 -* pytz >= 2015.7 +* pytz >= 2018.5 * croniter >= 0.3.24 Testing also requires: -* factory_boy >= 2.6.1 -* psycopg2 >= 2.6.1 +* factory_boy >= 2.11.1 ## Usage @@ -112,5 +111,4 @@ def count(): ## Reporting issues or Features -Please report issues via [GitHub Issues](https://github.com/istrategylabs/django-rq-scheduler/issues) . - +Please report issues via [GitHub Issues](https://github.com/isl-x/django-rq-scheduler/issues) . diff --git a/scheduler/admin.py b/scheduler/admin.py index e1f5782..b4a8a30 100644 --- a/scheduler/admin.py +++ b/scheduler/admin.py @@ -1,8 +1,7 @@ -from __future__ import unicode_literals from django.conf import settings from django.contrib import admin -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from scheduler.models import CronJob, RepeatableJob, ScheduledJob diff --git a/scheduler/apps.py b/scheduler/apps.py index 4411177..9a199c2 100644 --- a/scheduler/apps.py +++ b/scheduler/apps.py @@ -1,8 +1,7 @@ -from __future__ import unicode_literals from django.apps import AppConfig from django.db.models.functions import Now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class SchedulerConfig(AppConfig): diff --git a/scheduler/migrations/0001_initial.py b/scheduler/migrations/0001_initial.py index 2c89310..926cd42 100644 --- a/scheduler/migrations/0001_initial.py +++ b/scheduler/migrations/0001_initial.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-02 15:28 -from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone diff --git a/scheduler/migrations/0002_add_timeout.py b/scheduler/migrations/0002_add_timeout.py index 6b4390f..51fee50 100644 --- a/scheduler/migrations/0002_add_timeout.py +++ b/scheduler/migrations/0002_add_timeout.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-30 01:15 -from __future__ import unicode_literals from django.db import migrations, models diff --git a/scheduler/migrations/0003_remove_queue_choices.py b/scheduler/migrations/0003_remove_queue_choices.py index e0e36ec..ac216c7 100644 --- a/scheduler/migrations/0003_remove_queue_choices.py +++ b/scheduler/migrations/0003_remove_queue_choices.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-30 03:10 -from __future__ import unicode_literals from django.db import migrations, models diff --git a/scheduler/migrations/0004_add_cron_jobs.py b/scheduler/migrations/0004_add_cron_jobs.py index 9b3e686..351d282 100644 --- a/scheduler/migrations/0004_add_cron_jobs.py +++ b/scheduler/migrations/0004_add_cron_jobs.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-14 12:45 -from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone diff --git a/scheduler/models.py b/scheduler/models.py index b943105..b4258d8 100644 --- a/scheduler/models.py +++ b/scheduler/models.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals import importlib from datetime import timedelta @@ -8,15 +7,13 @@ from django.core.exceptions import ValidationError from django.db import models from django.templatetags.tz import utc -from django.utils.encoding import python_2_unicode_compatible -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import django_rq from model_utils import Choices from model_utils.models import TimeStampedModel -@python_2_unicode_compatible class BaseJob(TimeStampedModel): name = models.CharField(_('name'), max_length=128, unique=True) diff --git a/scheduler/tests.py b/scheduler/tests.py index fe1bc65..8ab4803 100644 --- a/scheduler/tests.py +++ b/scheduler/tests.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from datetime import datetime, timedelta from django.conf import settings diff --git a/setup.py b/setup.py index df7f8e0..28197d6 100644 --- a/setup.py +++ b/setup.py @@ -7,11 +7,11 @@ def long_desc(root_path): - FILES = ['README.md'] + FILES = ["README.md"] for filename in FILES: filepath = os.path.realpath(os.path.join(root_path, filename)) if os.path.isfile(filepath): - with open(filepath, mode='r') as f: + with open(filepath, mode="r") as f: yield f.read() @@ -20,10 +20,10 @@ def long_desc(root_path): def get_version(root_path): - with open(os.path.join(root_path, 'scheduler', '__init__.py')) as f: + with open(os.path.join(root_path, "scheduler", "__init__.py")) as f: for line in f: - if line.startswith('__version__ ='): - return line.split('=')[1].strip().strip('"\'') + if line.startswith("__version__ ="): + return line.split("=")[1].strip().strip("\"'") tests_require = [ @@ -32,38 +32,40 @@ def get_version(root_path): setup( - name='django-rq-scheduler', + name="django-rq-scheduler", version=get_version(PATH_OF_RUNNING_SCRIPT), - description='A database backed job scheduler for Django RQ', + description="A database backed job scheduler for Django RQ", long_description=long_description, packages=find_packages(), include_package_data=True, - author='ISL', - author_email='dev@isl.co', - url='https://github.com/istrategylabs/django-rq-scheduler', + author="Chad Shryock", + author_email="chad@keystone.works", + url="https://github.com/isl-x/django-rq-scheduler", zip_safe=True, install_requires=[ - 'django>=1.9.0', - 'django-model-utils>=2.4.0', - 'django-rq>=0.9.3', - 'rq-scheduler>=0.6.0', - 'pytz>=2018.5', - 'croniter>=0.3.24', + "django>=2.0", + "django-model-utils>=2.4.0", + "django-rq>=0.9.3", + "rq-scheduler>=0.6.0", + "pytz>=2018.5", + "croniter>=0.3.24", ], tests_require=tests_require, test_suite='scheduler.tests', extras_require={ - 'test': tests_require, + "test": tests_require, }, classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.6', - 'Framework :: Django', + "Development Status :: 4 - Beta", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Framework :: Django", + "Framework :: Django :: 2.0", + "Framework :: Django :: 3.0", ], ) diff --git a/testproject19/testproject19/urls.py b/testproject19/testproject19/urls.py index 10bad61..25303ae 100644 --- a/testproject19/testproject19/urls.py +++ b/testproject19/testproject19/urls.py @@ -13,9 +13,9 @@ 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -from django.conf.urls import url +from django.urls import re_path from django.contrib import admin urlpatterns = [ - url(r'^admin/', admin.site.urls), + re_path(r'^admin/', admin.site.urls), ]