Skip to content

Commit

Permalink
Merge 6f9022f into 11a61e0
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Dec 5, 2019
2 parents 11a61e0 + 6f9022f commit 551e5bd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ dist: xenial
language: python

python:
- 3.8
- 3.7
- 3.6
- 3.5

env:
- DJANGO="Django>=3.0,<3.1"
- DJANGO="Django>=2.2,<2.3"
- DJANGO="Django>=2.1,<2.2"
- DJANGO="Django>=2.0,<2.1"
Expand All @@ -21,6 +23,22 @@ install:

script: coverage run -a --source=sitetree setup.py test

matrix:

exclude:

- python: 3.8
env: DJANGO="Django>=1.10,<1.11"

- python: 3.8
env: DJANGO="Django>=1.9,<1.10"

- python: 3.8
env: DJANGO="Django>=1.8.6,<1.9"

- python: 3.5
env: DJANGO="Django>=3.0,<3.1"


after_success:
coveralls
3 changes: 1 addition & 2 deletions sitetree/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
except ImportError:
from django.core.urlresolvers import get_urlconf, get_resolver
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.http import HttpResponseRedirect
from django.contrib import admin
from django.contrib.admin.sites import NotRegistered
Expand Down Expand Up @@ -202,7 +201,7 @@ def get_form(self, request, obj=None, **kwargs):

def _stack_known_urls(self, reverse_dict, ns=None):
for url_name, url_rules in reverse_dict.items():
if isinstance(url_name, six.string_types):
if isinstance(url_name, str):
if ns is not None:
url_name = '%s:%s' % (ns, url_name)
self.known_url_names.append(url_name)
Expand Down
3 changes: 0 additions & 3 deletions sitetree/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.contrib.auth.models import Permission
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

from .settings import MODEL_TREE, TREE_ITEMS_ALIASES
Expand All @@ -19,7 +18,6 @@ def get_prep_value(self, value):
return self.to_python(value)


@python_2_unicode_compatible
class TreeBase(models.Model):

title = models.CharField(
Expand All @@ -41,7 +39,6 @@ def __str__(self):
return self.alias


@python_2_unicode_compatible
class TreeItemBase(models.Model):

PERM_TYPE_ANY = 1
Expand Down
6 changes: 2 additions & 4 deletions sitetree/sitetreeapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
VARIABLE_TAG_START)
from django.template.defaulttags import url as url_tag
from django.template.loader import get_template
from django.utils import six, module_loading
from django.utils.encoding import python_2_unicode_compatible
from django.utils import module_loading
from django.utils.http import urlquote
from django.utils.translation import get_language

Expand Down Expand Up @@ -265,7 +264,7 @@ def result(sitetrees=src):
'tree': target_tree_alias,
'parent_item': parent_tree_item_alias}

if isinstance(src, six.string_types):
if isinstance(src, str):
# Considered to be an application name.
try:
module = import_app_sitetree_module(src)
Expand All @@ -279,7 +278,6 @@ def result(sitetrees=src):
return result()


@python_2_unicode_compatible
class LazyTitle(object):
"""Lazily resolves any variable found in a title of an item.
Produces resolved title as unicode representation."""
Expand Down
3 changes: 1 addition & 2 deletions sitetree/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.apps import apps
from django.contrib.auth.models import Permission
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.module_loading import module_has_submodule

apps_get_model = apps.get_model
Expand Down Expand Up @@ -107,7 +106,7 @@ def item(
access_by_perms = [access_by_perms]

for perm in access_by_perms:
if isinstance(perm, six.string_types):
if isinstance(perm, str):
# Get permission object from string
try:
app, codename = perm.split('.')
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ install_command = pip install {opts} {packages}
skip_missing_interpreters = True

envlist =
py{35,36,37}-django{18,19,110,111,20,21,22}
py{35}-django{18,19,110,111,20,21,22}
py{36,37,38}-django{18,19,110,111,20,21,22,30}


[testenv]
Expand All @@ -16,3 +17,4 @@ deps =
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1

0 comments on commit 551e5bd

Please sign in to comment.