From 8a0fb6b8beb1d1621db2537ac25f747a786fa0b7 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Sat, 28 Nov 2020 12:15:52 +0100 Subject: [PATCH 1/2] Remove support for Python 3.5 --- .travis.yml | 2 -- debug_toolbar/panels/history/panel.py | 9 +-------- docs/changes.rst | 1 + setup.cfg | 3 +-- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 76998f37a..a5d62049f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,6 @@ matrix: - sudo apt-get -y install libenchant1c2a - env: TOXENV=style - env: TOXENV=readme - - python: 3.5 - env: TOXENV=py35-dj22-sqlite - python: 3.6 env: TOXENV=py36-dj22-sqlite - python: 3.7 diff --git a/debug_toolbar/panels/history/panel.py b/debug_toolbar/panels/history/panel.py index 64c985b84..ca05b749e 100644 --- a/debug_toolbar/panels/history/panel.py +++ b/debug_toolbar/panels/history/panel.py @@ -51,14 +51,7 @@ def generate_stats(self, request, response): and request.body and request.META.get("CONTENT_TYPE") == "application/json" ): - # Python <= 3.5's json.loads expects a string. - data = json.loads( - request.body - if sys.version_info[:2] > (3, 5) - else request.body.decode( - request.encoding or settings.DEFAULT_CHARSET - ) - ) + data = json.loads(request.body) except RawPostDataException: # It is not guaranteed that we may read the request data (again). data = None diff --git a/docs/changes.rst b/docs/changes.rst index 76a4fe1b4..cf8c2bf99 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -29,6 +29,7 @@ Change log * Started spellchecking the documentation. * Removed calls to the deprecated ``request.is_ajax()`` method. These calls were unnecessary now that most endpoints return JSON anyway. +* Removed support for Python 3.5. 3.1 (2020-09-21) diff --git a/setup.cfg b/setup.cfg index 0f95e92dc..870ef95ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,14 +22,13 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Topic :: Software Development :: Libraries :: Python Modules [options] -python_requires = >=3.5 +python_requires = >=3.6 install_requires = Django >= 2.2 sqlparse >= 0.2.0 From 929979cec0625a8f907d078bade41814b10b4d11 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Sat, 28 Nov 2020 12:18:05 +0100 Subject: [PATCH 2/2] Remove py35 from tox.ini too; make black target Python 3.6 --- Makefile | 4 ++-- tox.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 05ff29203..cab610452 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,14 @@ PRETTIER_TARGETS = '**/*.(css|js)' style: package-lock.json isort . - black --target-version=py35 . + black --target-version=py36 . flake8 npx eslint --ignore-path .gitignore --fix . npx prettier --ignore-path .gitignore --write $(PRETTIER_TARGETS) style_check: package-lock.json isort -c . - black --target-version=py35 --check . + black --target-version=py36 --check . flake8 npx eslint --ignore-path .gitignore . npx prettier --ignore-path .gitignore --check $(PRETTIER_TARGETS) diff --git a/tox.ini b/tox.ini index b8b930b1c..91ff4277b 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = docs style readme - py{35,36,37,38}-dj22-sqlite + py{36,37,38}-dj22-sqlite py{36,37,38}-dj{30,31}-sqlite py{36,37,38}-djmaster-sqlite py{37,38}-dj{22,30,31}-{postgresql,mariadb}