Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Django 3 #39

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ target/

# SQLite
*.sqlite3

# Ignore Virtualenv
/venv/
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) .
3 changes: 1 addition & 2 deletions scheduler/admin.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions scheduler/apps.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
1 change: 0 additions & 1 deletion scheduler/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion scheduler/migrations/0002_add_timeout.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion scheduler/migrations/0003_remove_queue_choices.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion scheduler/migrations/0004_add_cron_jobs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 1 addition & 4 deletions scheduler/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import unicode_literals
import importlib
from datetime import timedelta

Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion scheduler/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta

from django.conf import settings
Expand Down
54 changes: 28 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -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 = [
Expand All @@ -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='[email protected]',
url='https://github.com/istrategylabs/django-rq-scheduler',
author="Chad Shryock",
author_email="[email protected]",
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",
],
)
4 changes: 2 additions & 2 deletions testproject19/testproject19/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]