From 08c836fb922645f56f0ff43f85827ec3d5eec000 Mon Sep 17 00:00:00 2001 From: Johannes Wilm Date: Thu, 20 Aug 2020 05:27:59 +0200 Subject: [PATCH 1/3] remove six --- template_debug/tests/test_tags.py | 7 ------- template_debug/tests/test_utils.py | 7 ------- template_debug/utils.py | 11 +---------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/template_debug/tests/test_tags.py b/template_debug/tests/test_tags.py index fe9a6eb..75130c9 100644 --- a/template_debug/tests/test_tags.py +++ b/template_debug/tests/test_tags.py @@ -4,13 +4,6 @@ from template_debug.templatetags.debug_tags import require_template_debug -try: - from django.utils.six import PY3 -except ImportError: - range = xrange - PY3 = False - - @require_template_debug def test_func(): return 'test string' diff --git a/template_debug/tests/test_utils.py b/template_debug/tests/test_utils.py index 484433d..ae3c7e4 100644 --- a/template_debug/tests/test_utils.py +++ b/template_debug/tests/test_utils.py @@ -5,13 +5,6 @@ is_valid_in_template, get_attributes) -try: - from django.utils.six import PY3 -except ImportError: - range = xrange - PY3 = False - - class FlattenTestCase(TemplateDebugTestCase): """TestCase for _flatten""" diff --git a/template_debug/utils.py b/template_debug/utils.py index 5d04768..446ad93 100644 --- a/template_debug/utils.py +++ b/template_debug/utils.py @@ -1,23 +1,14 @@ -from __future__ import unicode_literals from functools import partial from collections import Iterable from inspect import getargspec, isroutine -try: - from django.utils.six import PY3, string_types -except ImportError: - # Django < 1.5. No Python 3 support - PY3 = False - string_types = basestring - - def _flatten(iterable): """ Given an iterable with nested iterables, generate a flat iterable """ for i in iterable: - if isinstance(i, Iterable) and not isinstance(i, string_types): + if isinstance(i, Iterable) and not isinstance(i, str): for sub_i in _flatten(i): yield sub_i else: From 0ff431d96f82f046182dfc1a5a83428b6481b0d4 Mon Sep 17 00:00:00 2001 From: Johannes Wilm Date: Thu, 20 Aug 2020 05:40:54 +0200 Subject: [PATCH 2/3] upgrade to Django 3.1 --- .travis.yml | 26 +++++++--------- docs/conf.py | 4 +-- example/urls.py | 5 +-- requirements/test.txt | 6 ++-- setup.py | 8 ++--- tox.ini | 72 +++++++++++++++++-------------------------- 6 files changed, 48 insertions(+), 73 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28eb3aa..04da3b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,17 @@ language: python python: - - "2.7" + - "3.8" env: - - TOXENV=py34-1.7 - - TOXENV=py34-1.6 - - TOXENV=py34-1.5 - - TOXENV=py33-1.7 - - TOXENV=py27-1.7 - - TOXENV=py33-1.6 - - TOXENV=py27-1.6 - - TOXENV=py33-1.5 - - TOXENV=py27-1.5 - - TOXENV=py27-1.4 - - TOXENV=py26-1.4 - - TOXENV=py27-1.3 - - TOXENV=py26-1.3 + - TOXENV=py36-2.2 + - TOXENV=py36-3.0 + - TOXENV=py36-3.1 + - TOXENV=py37-2.2 + - TOXENV=py37-3.0 + - TOXENV=py37-3.1 + - TOXENV=py38-2.2 + - TOXENV=py38-3.0 + - TOXENV=py38-3.1 install: - - pip install -q --use-mirrors tox==1.4.2 + - pip install -q --use-mirrors tox==3.19.0 script: - tox diff --git a/docs/conf.py b/docs/conf.py index 65f06b9..0527ce9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Sator documentation build configuration file, created by # sphinx-quickstart on Sun Jan 15 14:11:21 2012. @@ -11,7 +10,8 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os extensions = ['autodoc'] diff --git a/example/urls.py b/example/urls.py index 00cc0fe..1b804e5 100644 --- a/example/urls.py +++ b/example/urls.py @@ -1,7 +1,4 @@ -try: - from django.conf.urls import patterns, include, url -except ImportError: - from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, url from django.views.generic.base import TemplateView from example import views diff --git a/requirements/test.txt b/requirements/test.txt index b53b069..b200397 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,3 +1,3 @@ -Django==1.7 -Sphinx==1.2.3 -tox==1.7.2 +Django>=2.2 +Sphinx==3.2.1 +tox==3.19.0 diff --git a/setup.py b/setup.py index dcd33e8..a7f32b7 100755 --- a/setup.py +++ b/setup.py @@ -28,12 +28,10 @@ def read_file(filename): 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Software Development :: Libraries :: Python Modules', 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', diff --git a/tox.ini b/tox.ini index 8b3894b..9f08322 100644 --- a/tox.ini +++ b/tox.ini @@ -1,61 +1,45 @@ [tox] downloadcache = {toxworkdir}/_download/ -envlist = py34-1.7,py34-1.6,py34-1.5,py33-1.7,py27-1.7,py33-1.6,py27-1.6,py33-1.5,py27-1.5,py27-1.4,py26-1.4,py27-1.3,py26-1.3 +envlist = py36-2.2,py36-3.0,py36-3.1,py37-2.2,py37-3.0,py37-3.1,py38-2.2,py38-3.0,py38-3.1 [testenv] commands = {envpython} runtests.py -[testenv:py34-1.7] -basepython = python3.4 -deps = django>=1.7,<1.8 +[testenv:py36-2.2] +basepython = python3.6 +deps = django>=2.2,<3.0 -[testenv:py34-1.6] -basepython = python3.4 -deps = django>=1.6,<1.7 +[testenv:py36-3.0] +basepython = python3.6 +deps = django>=3.0,<3.1 -[testenv:py34-1.5] -basepython = python3.4 -deps = django>=1.5,<1.6 +[testenv:py36-3.1] +basepython = python3.6 +deps = django>=3.1,<3.2 -[testenv:py33-1.7] -basepython = python3.3 -deps = django>=1.7,<1.8 +[testenv:py37-2.2] +basepython = python3.7 +deps = django>=2.2,<3.0 -[testenv:py33-1.6] -basepython = python3.3 -deps = django>=1.6,<1.7 +[testenv:py37-3.0] +basepython = python3.7 +deps = django>=3.0,<3.1 -[testenv:py33-1.5] -basepython = python3.3 -deps = django>=1.5,<1.6 +[testenv:py37-3.1] +basepython = python3.7 +deps = django>=3.1,<3.2 -[testenv:py27-1.7] -basepython = python2.7 -deps = django>=1.7,<1.8 +[testenv:py38-2.2] +basepython = python3.8 +deps = django>=2.2,<3.0 -[testenv:py27-1.6] -basepython = python2.7 -deps = django>=1.6,<1.7 +[testenv:py38-3.0] +basepython = python3.8 +deps = django>=3.0,<3.1 -[testenv:py27-1.5] -basepython = python2.7 -deps = django>=1.5,<1.6 - -[testenv:py27-1.4] -basepython = python2.7 -deps = django>=1.4,<1.5 - -[testenv:py27-1.3] -basepython = python2.7 -deps = django>=1.3,<1.4 - -[testenv:py26-1.4] -basepython = python2.6 -deps = django>=1.4,<1.5 - -[testenv:py26-1.3] -basepython = python2.6 -deps = django>=1.3,<1.4 +[testenv:py38-3.1] +basepython = python3.8 +deps = django>=3.1,<3.2 #[testenv:docs] #basepython = python2.6 From b8ebaa639350ee0c03d589368153a0a0cb9eb110 Mon Sep 17 00:00:00 2001 From: Johannes Wilm Date: Fri, 21 Aug 2020 03:58:01 +0200 Subject: [PATCH 3/3] remove import from future --- template_debug/templatetags/debug_tags.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/template_debug/templatetags/debug_tags.py b/template_debug/templatetags/debug_tags.py index 1ffa6d7..8bd808f 100644 --- a/template_debug/templatetags/debug_tags.py +++ b/template_debug/templatetags/debug_tags.py @@ -2,8 +2,6 @@ Template tags that aid in common debugging scenarios. """ -from __future__ import unicode_literals - from pprint import pprint from django.conf import settings