Skip to content

Commit

Permalink
Merge 80830d1 into 0fba034
Browse files Browse the repository at this point in the history
  • Loading branch information
giff-h committed Jan 24, 2020
2 parents 0fba034 + 80830d1 commit cd76214
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 50 deletions.
18 changes: 5 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
env:
- DJANGO=1.7
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=2.2
- DJANGO=3.0
install:
# command to install dependencies
- "pip install coveralls"
Expand All @@ -22,12 +18,8 @@ script:
- coverage run --branch --source=notifications manage.py test
matrix:
exclude:
- python: "2.7"
env: DJANGO=2.0
- python: "3.5"
env: DJANGO=1.7
- python: "3.6"
env: DJANGO=1.7
env: DJANGO=3.0


after_success:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Nomenclature of this specification is based on the Activity Streams Spec: `<http
Requirements
============

- Python 2.7, 3.4, 3.5, 3.6
- Django 1.7, 1.8, 1.9, 1.10, 1.11, 2.0
- Python 3.5, 3.6, 3.7, 3.8
- Django 2.2, 3.0

Installation
============
Expand Down
13 changes: 13 additions & 0 deletions notifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@
__version__ = '1.4.0'

default_app_config = 'notifications.apps.Config' # pylint: disable=invalid-name


# patch jsonfield expectations until they actually update
def _patch_jsonfield_six():
import django
if django.VERSION >= (3,):
from django import utils
import six
utils.six = six


_patch_jsonfield_six()
del _patch_jsonfield_six
5 changes: 1 addition & 4 deletions notifications/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from django.db import models
from django.db.models.query import QuerySet
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.six import text_type
from jsonfield.fields import JSONField
from model_utils import Choices

Expand Down Expand Up @@ -139,7 +137,6 @@ def mark_as_sent(self, recipient=None):
return qset.update(emailed=True)


@python_2_unicode_compatible
class AbstractNotification(models.Model):
"""
Action model describing the actor acting out a verb (on an optional
Expand Down Expand Up @@ -290,7 +287,7 @@ def notify_handler(verb, **kwargs):
recipient=recipient,
actor_content_type=ContentType.objects.get_for_model(actor),
actor_object_id=actor.pk,
verb=text_type(verb),
verb=str(verb),
public=public,
description=description,
timestamp=timestamp,
Expand Down
2 changes: 0 additions & 2 deletions notifications/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
Expand Down
2 changes: 0 additions & 2 deletions notifications/migrations/0002_auto_20150224_1134.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


Expand Down
2 changes: 0 additions & 2 deletions notifications/migrations/0003_notification_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import jsonfield.fields

Expand Down
2 changes: 0 additions & 2 deletions notifications/migrations/0004_auto_20150826_1508.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.utils import timezone

Expand Down
2 changes: 0 additions & 2 deletions notifications/migrations/0005_auto_20160504_1520.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-04 15:20
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
23 changes: 11 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
author_email='yang@yangyubo.com',
url='http://github.com/django-notifications/django-notifications',
install_requires=[
'django>=1.7',
'django-model-utils>=2.0.3',
'django>=2.2',
'django-model-utils>=3.1.0',
'jsonfield>=1.0.3',
'six', # for jsonfield on django 3.0 until it drops py2 compat
'pytz',
'swapper'
],
test_requires=[
'django>=1.7',
'django-model-utils>=2.0.3',
'django>=2.2',
'django-model-utils>=3.1.0',
'jsonfield>=1.0.3',
'pytz'
],
Expand All @@ -55,18 +56,16 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Framework :: Django',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.7',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Utilities'
],
keywords='django notifications github action event stream',
Expand Down
14 changes: 5 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# -- FILE: tox.ini
[tox]
envlist =
py{27,33,34}-django17
py{27,33,34,35,36}-django{18,19,110,111}
py{34,35,36}-django200
py{35,36,37,38}-django22
py{36,37,38}-django30

[testenv]
commands =
coverage run --branch --source=notifications manage.py test
deps =
coverage
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<2.0
django200: Django>=2.0,<3.0
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django30: six

0 comments on commit cd76214

Please sign in to comment.