From d1ae1e8b423b8fa73a2af4e8b476557f36221b65 Mon Sep 17 00:00:00 2001 From: slei99 Date: Wed, 4 Dec 2019 16:54:27 +0100 Subject: [PATCH] switch to six for django3 compatibility (#24) * switch to six for django3 compatibility * update travis matrix for django3 * fix excludes * exclude legacy py versions for django3 * python-slugify dependency supports 2.7 and 3.5 and above only --- .gitignore | 7 +++++++ .travis.yml | 23 +++++++++++++++-------- requirements.txt | 1 + uuslug/uuslug.py | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index ba74660..fcdbec5 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,10 @@ docs/_build/ # PyBuilder target/ + +# VSCode +/.vscode/ + +# Pipenv +Pipfile +Pipfile.lock \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index a943cc4..a416c5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,7 @@ language: python python: - "3.5" - - "3.4" - - "3.3" + - "3.7" - "2.7" - pypy @@ -12,6 +11,7 @@ env: - DJANGO="django==1.10.6" - DJANGO="django==1.9.12" - DJANGO="django==1.8.17" + - DJANGO="django==3.0" install: - pip install $DJANGO @@ -27,12 +27,19 @@ before_script: matrix: exclude: - - python: "3.3" - env: DJANGO="django==1.10.6" - - python: "3.3" - env: DJANGO="django==1.9.12" + - python: "3.7" + env: DJANGO="django==1.10.6" + - python: "3.7" + env: DJANGO="django==1.9.12" + - python: "2.7" + env: DJANGO="django==3.0" + - python: "3.3" + env: DJANGO="django==3.0" + - python: "3.5" + env: DJANGO="django==3.0" + - python: pypy + env: DJANGO="django==3.0" script: coverage run --source=uuslug manage.py test -after_success: - coveralls +after_success: coveralls diff --git a/requirements.txt b/requirements.txt index 95a39d4..4728a47 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ Django>=1.8 python-slugify>=1.2.1 +six>=1.13.0 \ No newline at end of file diff --git a/uuslug/uuslug.py b/uuslug/uuslug.py index 8b331ae..215ddb3 100644 --- a/uuslug/uuslug.py +++ b/uuslug/uuslug.py @@ -1,6 +1,6 @@ from django.db.models.base import ModelBase from slugify import slugify as pyslugify -from django.utils import six +import six if six.PY3: from django.utils.encoding import smart_str else: