From 5dc5f97a58135e531e11bcdd89d6330e48de87cd Mon Sep 17 00:00:00 2001 From: Rubin D Mendoza Date: Sun, 9 Feb 2020 23:59:51 -0600 Subject: [PATCH 1/3] TASK-Remove-References-To-Django-Six - Updated references from using django.six to just six --- dev_requirements.txt | 1 + djqscsv/djqscsv.py | 2 +- test_app/djqscsv_tests/models.py | 2 +- test_app/djqscsv_tests/tests/test_csv_creation.py | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index b1657b6..cf509c8 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -2,4 +2,5 @@ coveralls==0.3 coverage==3.6 flake8==2.5.1 django>=1.5 +six==1.14.0 unicodecsv>=0.14.1 diff --git a/djqscsv/djqscsv.py b/djqscsv/djqscsv.py index d6e67da..c530fc1 100644 --- a/djqscsv/djqscsv.py +++ b/djqscsv/djqscsv.py @@ -6,7 +6,7 @@ from django.utils.text import slugify from django.http import HttpResponse, StreamingHttpResponse -from django.utils import six +import six """ A simple python package for turning django models into csvs """ diff --git a/test_app/djqscsv_tests/models.py b/test_app/djqscsv_tests/models.py index 49d3499..14ef452 100644 --- a/test_app/djqscsv_tests/models.py +++ b/test_app/djqscsv_tests/models.py @@ -1,7 +1,7 @@ +from six import python_2_unicode_compatible from django.db import models from django.utils.translation import ugettext as _ -from django.utils.encoding import python_2_unicode_compatible from datetime import datetime SOME_TIME = datetime(2001, 1, 1, 1, 1) diff --git a/test_app/djqscsv_tests/tests/test_csv_creation.py b/test_app/djqscsv_tests/tests/test_csv_creation.py index 6b97732..6f1ba19 100644 --- a/test_app/djqscsv_tests/tests/test_csv_creation.py +++ b/test_app/djqscsv_tests/tests/test_csv_creation.py @@ -13,9 +13,12 @@ from djqscsv_tests.util import create_people_and_get_queryset try: - from django.utils.six.moves import zip_longest + from six.moves import zip_longest except ImportError: - from itertools import izip_longest as zip_longest + try: + from itertools import izip_longest as zip_longest + except ImportError: + from itertools import zip_longest class CSVTestCase(TestCase): From f9db758dfc238d78350ee5d4373d5e62594ecd41 Mon Sep 17 00:00:00 2001 From: Justin Walgran Date: Tue, 24 Mar 2020 08:05:20 -0700 Subject: [PATCH 2/3] Update version matrix in .travis.yml and update test tools The main motivation for this change was to add testing for Django 3.0. While adding that version we also add the interim Django versions and Python 3.x versions. Several of these are not supported, but testing on these older versions may allow an application that is stuck on an old version for financial or other reasons to still consider adding djqscsv. Python 3.5 is no longer installable so it is excluded. Supporting Python 3.8 required updated versions of flake8 and coverage. We opted to upgrade to the latest versions because they still have support back to Python 2.7. --- .travis.yml | 13 ++++++++++++- dev_requirements.txt | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a6a976..759ef12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ sudo: false python: - 2.7 - - 3.5 + - 3.6 + - 3.7 + - 3.8 env: - DJANGO=1.8 @@ -12,11 +14,20 @@ env: - DJANGO=1.10 - DJANGO=1.11 - DJANGO=2.0 + - DJANGO=2.1 + - DJANGO=2.2 + - DJANGO=3.0 matrix: exclude: - python: 2.7 env: DJANGO=2.0 + - python: 2.7 + env: DJANGO=2.1 + - python: 2.7 + env: DJANGO=2.2 + - python: 2.7 + env: DJANGO=3.0 - python: 3.5 env: DJANGO=1.6 - python: 3.5 diff --git a/dev_requirements.txt b/dev_requirements.txt index cf509c8..d7231f6 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,6 +1,6 @@ coveralls==0.3 -coverage==3.6 -flake8==2.5.1 +coverage==5.0.4 +flake8==3.7.9 django>=1.5 six==1.14.0 unicodecsv>=0.14.1 From 7ec51f6c7618bf4a4d306ba17baca2d6efcd4f67 Mon Sep 17 00:00:00 2001 From: Justin Walgran Date: Tue, 24 Mar 2020 08:45:29 -0700 Subject: [PATCH 3/3] Add condition to Travis CI deployment We update the `on` section in `.travis.yml` so that we only attempt to deploy once. Repeated attempts to deploy the same version result in failed builds even though the tests succeed. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 759ef12..6ab41b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,5 +52,6 @@ deploy: secure: Wb3ow0qdnjFsdIoC2Lvke0Rp6h40WNDkp4Fuyltd0ex2MQMglNo1qHZYlhQvJ/5q7pHEAO7pIqOMzOQ1mls9Za1/AoolEl3zm9b3oW86bAR8AVS/UdCUkkCmPaO+0VsYCt63McaLFA0xQnWxA7kZUkfEeS7RBhT63f+diPqg2fU= on: tags: true + python: 3.7 distributions: sdist bdist_wheel repo: azavea/django-queryset-csv