Skip to content

Commit

Permalink
Merge pull request #65 from edx/drop-python35-support
Browse files Browse the repository at this point in the history
Dropped support for python 3.5
  • Loading branch information
UsamaSadiq authored Jan 18, 2021
2 parents 9ce592d + 8559e81 commit 51e103b
Show file tree
Hide file tree
Showing 104 changed files with 587 additions and 587 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python CI

on:
push:
branches: [master]
pull_request:
branches:
- '**'

jobs:
run_tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22, django30, django31]
steps:
- uses: actions/checkout@v1
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
language: python
python:
- 3.5
- 3.8
install:
- pip install -r requirements/travis.txt
matrix:
- python: 3.5
env: TOXENV=py35-django22
- python: 3.8
env: TOXENV=py38-django22
- pip install -r requirements/ci.txt
env:
- TOXENV=py38-django22
- TOXENV=py38-django30
- TOXENV=py38-django31
script:
- tox
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade:
pip install -q -r requirements/pip_tools.txt
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/docs.txt requirements/docs.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version for tests
grep -e "^django==" requirements/base.txt > requirements/django.txt
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
Expand Down
2 changes: 0 additions & 2 deletions django_notify/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from django.contrib import admin

from django_notify import models
Expand Down
3 changes: 0 additions & 3 deletions django_notify/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

import json

from django.contrib.auth.decorators import login_required
Expand Down
3 changes: 0 additions & 3 deletions django_notify/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
Expand Down
33 changes: 15 additions & 18 deletions django_notify/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.db import models
Expand All @@ -15,9 +12,9 @@ class NotificationType(models.Model):
"""
Notification types are added on-the-fly by the
applications adding new notifications"""
key = models.CharField(max_length=128, primary_key=True, verbose_name=_(u'unique key'),
key = models.CharField(max_length=128, primary_key=True, verbose_name=_('unique key'),
unique=True)
label = models.CharField(max_length=128, verbose_name=_(u'verbose name'),
label = models.CharField(max_length=128, verbose_name=_('verbose name'),
blank=True, null=True)
content_type = models.ForeignKey(ContentType, blank=True, null=True, on_delete=models.CASCADE)

Expand All @@ -27,31 +24,31 @@ def __unicode__(self):
class Meta:
app_label = 'django_notify'
db_table = settings.DB_TABLE_PREFIX + '_notificationtype'
verbose_name = _(u'type')
verbose_name_plural = _(u'types')
verbose_name = _('type')
verbose_name_plural = _('types')

class Settings(models.Model):

user = models.ForeignKey(User, on_delete=models.CASCADE)
interval = models.SmallIntegerField(choices=settings.INTERVALS, verbose_name=_(u'interval'),
interval = models.SmallIntegerField(choices=settings.INTERVALS, verbose_name=_('interval'),
default=settings.INTERVALS_DEFAULT)

def __unicode__(self):
return _(u"Settings for %s") % self.user.username
return _("Settings for %s") % self.user.username

class Meta:
app_label = 'django_notify'
db_table = settings.DB_TABLE_PREFIX + '_settings'
verbose_name = _(u'settings')
verbose_name_plural = _(u'settings')
verbose_name = _('settings')
verbose_name_plural = _('settings')

class Subscription(models.Model):

subscription_id = models.AutoField(primary_key=True)
settings = models.ForeignKey(Settings, on_delete=models.CASCADE)
notification_type = models.ForeignKey(NotificationType, on_delete=models.CASCADE)
object_id = models.CharField(max_length=64, null=True, blank=True,
help_text=_(u'Leave this blank to subscribe to any kind of object'))
help_text=_('Leave this blank to subscribe to any kind of object'))
send_emails = models.BooleanField(default=True)

def __unicode__(self):
Expand All @@ -60,14 +57,14 @@ def __unicode__(self):
class Meta:
app_label = 'django_notify'
db_table = settings.DB_TABLE_PREFIX + '_subscription'
verbose_name = _(u'subscription')
verbose_name_plural = _(u'subscriptions')
verbose_name = _('subscription')
verbose_name_plural = _('subscriptions')

class Notification(models.Model):

subscription = models.ForeignKey(Subscription, null=True, blank=True, on_delete=models.SET_NULL)
message = models.TextField()
url = models.URLField(blank=True, null=True, verbose_name=_(u'link for notification'))
url = models.URLField(blank=True, null=True, verbose_name=_('link for notification'))
is_viewed = models.BooleanField(default=False)
is_emailed = models.BooleanField(default=False)
created = models.DateTimeField(auto_now_add=True)
Expand Down Expand Up @@ -106,8 +103,8 @@ def __unicode__(self):
class Meta:
app_label = 'django_notify'
db_table = settings.DB_TABLE_PREFIX + '_notification'
verbose_name = _(u'notification')
verbose_name_plural = _(u'notifications')
verbose_name = _('notification')
verbose_name_plural = _('notifications')


def notify(message, key, target_object=None, url=None):
Expand All @@ -133,7 +130,7 @@ def notify(message, key, target_object=None, url=None):

if target_object:
if not isinstance(target_object, Model):
raise TypeError(_(u"You supplied a target_object that's not an instance of a django Model."))
raise TypeError(_("You supplied a target_object that's not an instance of a django Model."))
object_id = target_object.id
else:
object_id = None
Expand Down
8 changes: 3 additions & 5 deletions django_notify/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from django.conf import settings as django_settings

_ = lambda x: x
Expand All @@ -22,9 +20,9 @@
WEEKLY = 7*24-1

INTERVALS = getattr(django_settings, "NOTIFY_INTERVALS",
[(INSTANTLY, _(u'instantly')),
(DAILY, _(u'daily')),
(WEEKLY, _(u'weekly'))])
[(INSTANTLY, _('instantly')),
(DAILY, _('daily')),
(WEEKLY, _('weekly'))])

INTERVALS_DEFAULT = INSTANTLY

Expand Down
1 change: 0 additions & 1 deletion django_notify/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Replace this with more appropriate tests for your application.
"""

from __future__ import absolute_import

from django.test import TestCase

Expand Down
7 changes: 2 additions & 5 deletions django_notify/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

from django.conf.urls import url

from django_notify import views

urlpatterns = [
url('^json/get/$', views.get_notifications, name='json_get', kwargs={}),
url('^json/mark-read/$', views.mark_read, name='json_mark_read_base', kwargs={}),
url('^json/mark-read/(\d+)/$', views.mark_read, name='json_mark_read', kwargs={}),
url('^goto/(?P<notification_id>\d+)/$', views.goto, name='goto', kwargs={}),
url(r'^json/mark-read/(\d+)/$', views.mark_read, name='json_mark_read', kwargs={}),
url(r'^goto/(?P<notification_id>\d+)/$', views.goto, name='goto', kwargs={}),
url('^goto/$', views.goto, name='goto_base', kwargs={}),
]

Expand Down
4 changes: 0 additions & 4 deletions django_notify/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import

from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, redirect

Expand Down
18 changes: 8 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# django-wiki documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 23 16:13:51 2012.
Expand All @@ -11,7 +10,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from __future__ import absolute_import

import os
import sys
Expand Down Expand Up @@ -43,8 +41,8 @@
master_doc = 'index'

# General information about the project.
project = u'django-wiki'
copyright = u'2012, Benjamin Bach'
project = 'django-wiki'
copyright = '2012, Benjamin Bach'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -186,8 +184,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'django-wiki.tex', u'django-wiki Documentation',
u'Benjamin Bach', 'manual'),
('index', 'django-wiki.tex', 'django-wiki Documentation',
'Benjamin Bach', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -216,8 +214,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'django-wiki', u'django-wiki Documentation',
[u'Benjamin Bach'], 1)
('index', 'django-wiki', 'django-wiki Documentation',
['Benjamin Bach'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -230,8 +228,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'django-wiki', u'django-wiki Documentation',
u'Benjamin Bach', 'django-wiki', 'One line description of project.',
('index', 'django-wiki', 'django-wiki Documentation',
'Benjamin Bach', 'django-wiki', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ django
django-mptt
django-sekizai
Markdown
six # Use for strings and unicode compatibility
sorl-thumbnail # Required by wiki.plugins.images
47 changes: 33 additions & 14 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,36 @@
#
# make upgrade
#
bleach==3.1.5 # via -r requirements/base.in
django-classy-tags==1.0.0 # via django-sekizai
django-js-asset==1.2.2 # via django-mptt
django-mptt==0.11.0 # via -r requirements/base.in
django-sekizai==1.1.0 # via -r requirements/base.in
django==2.2.14 # via -c requirements/constraints.txt, -r requirements/base.in, django-classy-tags, django-mptt, django-sekizai
markdown==2.6.11 # via -c requirements/constraints.txt, -r requirements/base.in
packaging==20.4 # via bleach
pyparsing==2.4.7 # via packaging
pytz==2020.1 # via django
six==1.15.0 # via -r requirements/base.in, bleach, django-classy-tags, django-sekizai, packaging
sorl-thumbnail==12.6.3 # via -r requirements/base.in
sqlparse==0.3.1 # via django
webencodings==0.5.1 # via bleach
bleach==3.2.1
# via -r requirements/base.in
django-classy-tags==2.0.0
# via django-sekizai
django-js-asset==1.2.2
# via django-mptt
django-mptt==0.11.0
# via -r requirements/base.in
django-sekizai==2.0.0
# via -r requirements/base.in
django==2.2.17
# via
# -c requirements/constraints.txt
# -r requirements/base.in
# django-classy-tags
# django-mptt
# django-sekizai
markdown==3.3.3
# via -r requirements/base.in
packaging==20.8
# via bleach
pyparsing==2.4.7
# via packaging
pytz==2020.5
# via django
six==1.15.0
# via bleach
sorl-thumbnail==12.7.0
# via -r requirements/base.in
sqlparse==0.4.1
# via django
webencodings==0.5.1
# via bleach
File renamed without changes.
Loading

0 comments on commit 51e103b

Please sign in to comment.