From 95c6a481086a5f0a0129d02a1e6400e833817b6f Mon Sep 17 00:00:00 2001 From: Hameed Gifford Date: Sun, 19 Jan 2020 01:18:25 -0500 Subject: [PATCH] Test python 3.8 and Django 3.0 Aligns the doc specs to match tested versions --- .travis.yml | 17 ++++++----------- README.rst | 4 ++-- notifications/__init__.py | 13 +++++++++++++ notifications/base/models.py | 5 +---- notifications/migrations/0001_initial.py | 2 -- .../migrations/0002_auto_20150224_1134.py | 2 -- .../migrations/0003_notification_data.py | 2 -- .../migrations/0004_auto_20150826_1508.py | 2 -- .../migrations/0005_auto_20160504_1520.py | 2 -- setup.py | 18 ++++++++++-------- tox.ini | 15 +++++++-------- 11 files changed, 39 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92f1f96..ed8f12b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,15 @@ 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.1 + - DJANGO=2.2 + - DJANGO=3.0 install: # command to install dependencies - "pip install coveralls" @@ -22,12 +21,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: diff --git a/README.rst b/README.rst index 8e81d91..0f4844c 100644 --- a/README.rst +++ b/README.rst @@ -28,8 +28,8 @@ Nomenclature of this specification is based on the Activity Streams Spec: `= (3,): + from django import utils + import six + utils.six = six + + +_patch_jsonfield_six() +del _patch_jsonfield_six diff --git a/notifications/base/models.py b/notifications/base/models.py index 3fae25d..c563857 100644 --- a/notifications/base/models.py +++ b/notifications/base/models.py @@ -11,8 +11,6 @@ from django.core.exceptions import ImproperlyConfigured 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 @@ -139,7 +137,6 @@ class NotificationQuerySet(models.query.QuerySet): 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 @@ -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, diff --git a/notifications/migrations/0001_initial.py b/notifications/migrations/0001_initial.py index 4423ccd..03f0c75 100644 --- a/notifications/migrations/0001_initial.py +++ b/notifications/migrations/0001_initial.py @@ -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 diff --git a/notifications/migrations/0002_auto_20150224_1134.py b/notifications/migrations/0002_auto_20150224_1134.py index 5e34689..51273de 100644 --- a/notifications/migrations/0002_auto_20150224_1134.py +++ b/notifications/migrations/0002_auto_20150224_1134.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import models, migrations diff --git a/notifications/migrations/0003_notification_data.py b/notifications/migrations/0003_notification_data.py index 871e0b3..a7840a2 100644 --- a/notifications/migrations/0003_notification_data.py +++ b/notifications/migrations/0003_notification_data.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import models, migrations import jsonfield.fields diff --git a/notifications/migrations/0004_auto_20150826_1508.py b/notifications/migrations/0004_auto_20150826_1508.py index a109dc1..656b420 100644 --- a/notifications/migrations/0004_auto_20150826_1508.py +++ b/notifications/migrations/0004_auto_20150826_1508.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import models, migrations from django.utils import timezone diff --git a/notifications/migrations/0005_auto_20160504_1520.py b/notifications/migrations/0005_auto_20160504_1520.py index 223cb1b..dd1b8c1 100644 --- a/notifications/migrations/0005_auto_20160504_1520.py +++ b/notifications/migrations/0005_auto_20160504_1520.py @@ -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 diff --git a/setup.py b/setup.py index 142b7f9..663d94b 100755 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ setup( 'django>=1.7', 'django-model-utils>=2.0.3', 'jsonfield>=1.0.3', + 'six', # for jsonfield on django 3.0 until it drops py2 compat 'pytz', 'swapper' ], @@ -55,18 +56,19 @@ setup( '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 :: 1.11', + 'Framework :: Django :: 2.0', + 'Framework :: Django :: 2.1', + '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', diff --git a/tox.ini b/tox.ini index 2333c66..e7525f8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,17 @@ # -- 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}-django{111,20,21,22} + 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 + django20: Django>=2.0,<2.1 + django21: Django>=2.1,<2.2 + django22: Django>=2.2,<2.3 + django30: Django>=3.0,<3.1 + django30: six