From 0a398ea63a33b93d31aeda95fca92b433bcdf42a Mon Sep 17 00:00:00 2001 From: Chad Shryock Date: Wed, 8 Jan 2020 13:48:46 -0500 Subject: [PATCH 1/5] Upgrade django requirements --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 54b421d..1ece39f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 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 @@ -113,4 +113,3 @@ def count(): ## Reporting issues or Features Please report issues via [GitHub Issues](https://github.com/istrategylabs/django-rq-scheduler/issues) . - From a888790ec845389ceb7a7ca54a954ce9b6da2bb6 Mon Sep 17 00:00:00 2001 From: Chad Shryock Date: Wed, 8 Jan 2020 13:49:50 -0500 Subject: [PATCH 2/5] Update basic config --- setup.py | 58 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/setup.py b/setup.py index e24117f..e923017 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,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() @@ -19,49 +19,49 @@ 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 = [ - 'factory_boy>=2.6.1', - 'psycopg2>=2.6.1', + "factory_boy>=2.6.1", + "psycopg2>=2.6.1", ] setup( - name='django-rq-scheduler', + name="django-rq-scheduler", version=get_version(HERE), - 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='Chad Shryock', - author_email='chad@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>=2015.7', - 'croniter>=0.3.24', + "django>=2.0", + "django-model-utils>=2.4.0", + "django-rq>=0.9.3", + "rq-scheduler>=0.6.0", + "pytz>=2015.7", + "croniter>=0.3.24", ], tests_require=tests_require, - extras_require={ - 'test': tests_require, - }, + extras_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', - '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", ], ) From d3e9d9eb339c2516e352bee9400e78345f451b7b Mon Sep 17 00:00:00 2001 From: Chad Shryock Date: Wed, 8 Jan 2020 13:50:02 -0500 Subject: [PATCH 3/5] Remove python_2_unicode_compatible --- scheduler/models.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scheduler/models.py b/scheduler/models.py index b943105..f769934 100644 --- a/scheduler/models.py +++ b/scheduler/models.py @@ -8,7 +8,6 @@ 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 _ import django_rq @@ -16,7 +15,6 @@ from model_utils.models import TimeStampedModel -@python_2_unicode_compatible class BaseJob(TimeStampedModel): name = models.CharField(_('name'), max_length=128, unique=True) From 2b3b0a8536f27f51a9d901512f71bc0d42381f09 Mon Sep 17 00:00:00 2001 From: Chad Shryock Date: Wed, 8 Jan 2020 15:29:17 -0500 Subject: [PATCH 4/5] Squashed commit of the following: commit 901687fe27d241fa21f10838b3f1caffce258054 Author: Marc Laughton Date: Wed Jan 8 14:27:51 2020 -0500 Update setup py for pypi distribution (#26) * Add runtime for Python deployment and build tools, update Python version for Circle config * Update setup.py for more accurate PyPi info, test_suite path, and current package maintainer contact info * Isolate PR changes * 2.7.6 to 2.7.9 per master --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index e923017..d41c818 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import os from distutils.core import setup + from setuptools import find_packages @@ -14,8 +15,8 @@ def long_desc(root_path): yield f.read() -HERE = os.path.abspath(os.path.dirname(__file__)) -long_description = "\n\n".join(long_desc(HERE)) +PATH_OF_RUNNING_SCRIPT = os.path.abspath(os.path.dirname(__file__)) +long_description = "\n\n".join(long_desc(PATH_OF_RUNNING_SCRIPT)) def get_version(root_path): @@ -26,8 +27,7 @@ def get_version(root_path): tests_require = [ - "factory_boy>=2.6.1", - "psycopg2>=2.6.1", + 'factory_boy>=2.11.1', ] From 79a6c7a26b482302f3ee73467b97572f0c31effa Mon Sep 17 00:00:00 2001 From: Thomas Price Date: Wed, 16 Sep 2020 14:52:32 -0400 Subject: [PATCH 5/5] Removing Python 2 support and addressing Django Deprecation Warnings --- .gitignore | 3 +++ README.md | 7 +++---- scheduler/admin.py | 3 +-- scheduler/apps.py | 3 +-- scheduler/migrations/0001_initial.py | 1 - scheduler/migrations/0002_add_timeout.py | 1 - scheduler/migrations/0003_remove_queue_choices.py | 1 - scheduler/migrations/0004_add_cron_jobs.py | 1 - scheduler/models.py | 3 +-- scheduler/tests.py | 1 - testproject19/testproject19/urls.py | 4 ++-- 11 files changed, 11 insertions(+), 17 deletions(-) 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 1ece39f..851deeb 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,12 @@ Currently, when you pip install Django RQ Scheduler the following packages are a * 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,4 +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 f769934..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,7 +7,7 @@ from django.core.exceptions import ValidationError from django.db import models from django.templatetags.tz import utc -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import django_rq from model_utils import Choices 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/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), ]