From e51582c9e4389376fae1bc921b3ef26e008bf996 Mon Sep 17 00:00:00 2001 From: Jawayria Date: Fri, 17 Sep 2021 18:48:57 +0500 Subject: [PATCH] feat: Added support for Django3.2 --- .travis.yml | 1 + imagemodal/mixins/scenario.py | 2 +- imagemodal/settings.py | 1 + setup.py | 7 ++++++- tox.ini | 39 ++++++++++++++++++----------------- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6beb40b..a77f326 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ env: - TOX_ENV=django22 - TOX_ENV=django30 - TOX_ENV=django31 + - TOX_ENV=django32 before_install: - export BOTO_CONFIG=/dev/null - pip install pip==20.0.2 diff --git a/imagemodal/mixins/scenario.py b/imagemodal/mixins/scenario.py index 6b59895..e08255a 100644 --- a/imagemodal/mixins/scenario.py +++ b/imagemodal/mixins/scenario.py @@ -9,7 +9,7 @@ def _read_file(file_path): """ Read in a file's contents """ - with open(file_path) as file_input: + with open(file_path, encoding='utf-8') as file_input: file_contents = file_input.read() return file_contents diff --git a/imagemodal/settings.py b/imagemodal/settings.py index 58b67d2..3295392 100644 --- a/imagemodal/settings.py +++ b/imagemodal/settings.py @@ -15,3 +15,4 @@ 'imagemodal/translations', ] SECRET_KEY = 'SECRET_KEY' +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' diff --git a/setup.py b/setup.py index fc2949c..7641673 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup -version = '2.0.0' +version = '2.1.0' description = __doc__.strip().split('\n')[0] this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.rst')) as file_in: @@ -76,6 +76,11 @@ def is_requirement(line): 'Programming Language :: Python :: 3.8', 'Topic :: Education', 'Topic :: Internet :: WWW/HTTP', + 'Framework :: Django', + 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', + 'Framework :: Django :: 3.2', ], test_suite='imagemodal.tests', ) diff --git a/tox.ini b/tox.ini index 25b4e0d..f03954c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,30 +1,31 @@ [tox] -envlist = csslint,eslint,py38-django{22,30,31},quality +envlist = csslint,eslint,py38-django{22,30,31,32},quality [testenv] deps = - django22: Django>=2.2,<2.3 - django30: Django>=3.0,<3.1 - django31: Django>=3.1,<3.2 - -rrequirements/test.txt + django22: Django>=2.2,<2.3 + django30: Django>=3.0,<3.1 + django31: Django>=3.1,<3.2 + django32: Django>=3.2,<4.0 + -rrequirements/test.txt commands = - coverage run manage.py test - coverage report - coverage html + coverage run manage.py test + coverage report + coverage html [testenv:clean] commands = - coverage erase + coverage erase deps = - -rrequirements/test.txt + -rrequirements/test.txt skip_install = True [testenv:csslint] whitelist_externals = {toxinidir}/node_modules/csslint/dist/cli.js passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH commands = - make requirements_js - {toxinidir}/node_modules/csslint/dist/cli.js imagemodal/public/ + make requirements_js + {toxinidir}/node_modules/csslint/dist/cli.js imagemodal/public/ deps = skip_install = True @@ -32,22 +33,22 @@ skip_install = True whitelist_externals = {toxinidir}/node_modules/eslint/bin/eslint.js passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH commands = - make requirements_js - {toxinidir}/node_modules/eslint/bin/eslint.js --fix imagemodal/public/view.js + make requirements_js + {toxinidir}/node_modules/eslint/bin/eslint.js --fix imagemodal/public/view.js deps = skip_install = True [testenv:quality] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH deps = - -rrequirements/quality.txt + -rrequirements/quality.txt commands = - pycodestyle imagemodal/ - pylint imagemodal/ + pycodestyle imagemodal/ + pylint imagemodal/ [testenv:transifex] deps = - transifex-client + transifex-client commands = - tx push -s + tx push -s