From c60dbce48bcccd6a70f5db892ae4684c121ec081 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:10:41 -0500 Subject: [PATCH 01/18] Drop Flask 0.11 There is no 0.11.x bugfix branch in pallets/flask, so probably unsupported. --- tests/constraints/flask-0.11.txt | 2 -- tox.ini | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 tests/constraints/flask-0.11.txt diff --git a/tests/constraints/flask-0.11.txt b/tests/constraints/flask-0.11.txt deleted file mode 100644 index 9be2c91..0000000 --- a/tests/constraints/flask-0.11.txt +++ /dev/null @@ -1,2 +0,0 @@ -Flask<0.12 -Werkzeug<1.0.0 diff --git a/tox.ini b/tox.ini index 2d86f9d..cba38e6 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py38-docs py{36,37,38,39}-dj{22,30,31} py{38,39}-dj{40} - py{36,37,38,39}-fl{011,012,10} + py{36,37,38,39}-fl{012,10} py{36,37,38,39}-s{19,20} [gh-actions] @@ -25,13 +25,12 @@ setenv = deps = -rtests/requirements/default.txt dj{22,30,31,40}: -rtests/requirements/django.txt - fl{011,012,10}: -rtests/requirements/flask.txt + fl{012,10}: -rtests/requirements/flask.txt s{19,20}: -rtests/requirements/sanic.txt dj22: -ctests/constraints/django-2.2.txt dj30: -ctests/constraints/django-3.0.txt dj31: -ctests/constraints/django-3.1.txt dj40: -ctests/constraints/django-4.0.txt - fl011: -ctests/constraints/flask-0.11.txt fl012: -ctests/constraints/flask-0.12.txt fl10: -ctests/constraints/flask-1.0.txt s19: -ctests/constraints/sanic-19.txt @@ -39,7 +38,7 @@ deps = commands = python --version dj{22,30,31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} - fl{011,012,10}: pytest tests/core/ tests/flask/ {posargs:} + fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} [testenv:py38-docs] From 2690d252d3861ea8ec033263f548a400702c6da1 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:23:19 -0500 Subject: [PATCH 02/18] Remove Django 2.2 Extended support ended April 2022 --- setup.py | 1 - tests/constraints/django-2.2.txt | 1 - tox.ini | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 tests/constraints/django-2.2.txt diff --git a/setup.py b/setup.py index 9d03122..96d63b7 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ def read(*parts): "Development Status :: 5 - Production/Stable", "Environment :: Web Environment :: Mozilla", "Framework :: Django", - "Framework :: Django :: 2.2", "Framework :: Django :: 3.0", "Framework :: Django :: 3.1", "Framework :: Flask", diff --git a/tests/constraints/django-2.2.txt b/tests/constraints/django-2.2.txt deleted file mode 100644 index 1bbec6f..0000000 --- a/tests/constraints/django-2.2.txt +++ /dev/null @@ -1 +0,0 @@ -Django<2.3 diff --git a/tox.ini b/tox.ini index cba38e6..f3ff2d2 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ minversion = 1.8 envlist = py38-lint py38-docs - py{36,37,38,39}-dj{22,30,31} + py{36,37,38,39}-dj{30,31} py{38,39}-dj{40} py{36,37,38,39}-fl{012,10} py{36,37,38,39}-s{19,20} @@ -24,10 +24,9 @@ setenv = PYTHONPATH = {toxinidir} deps = -rtests/requirements/default.txt - dj{22,30,31,40}: -rtests/requirements/django.txt + dj{30,31,40}: -rtests/requirements/django.txt fl{012,10}: -rtests/requirements/flask.txt s{19,20}: -rtests/requirements/sanic.txt - dj22: -ctests/constraints/django-2.2.txt dj30: -ctests/constraints/django-3.0.txt dj31: -ctests/constraints/django-3.1.txt dj40: -ctests/constraints/django-4.0.txt @@ -37,7 +36,7 @@ deps = s20: -ctests/constraints/sanic-20.txt commands = python --version - dj{22,30,31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} + dj{30,31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} From c405e595fb754bf66d407e3db517fcacd86aaa04 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:24:42 -0500 Subject: [PATCH 03/18] Remove Django 3.0 Extended support ended April 2021 --- setup.py | 1 - tests/constraints/django-3.0.txt | 1 - tox.ini | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 tests/constraints/django-3.0.txt diff --git a/setup.py b/setup.py index 96d63b7..b5716d3 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ def read(*parts): "Development Status :: 5 - Production/Stable", "Environment :: Web Environment :: Mozilla", "Framework :: Django", - "Framework :: Django :: 3.0", "Framework :: Django :: 3.1", "Framework :: Flask", "Intended Audience :: Developers", diff --git a/tests/constraints/django-3.0.txt b/tests/constraints/django-3.0.txt deleted file mode 100644 index d6e4bf2..0000000 --- a/tests/constraints/django-3.0.txt +++ /dev/null @@ -1 +0,0 @@ -Django>=3.0,<3.1 diff --git a/tox.ini b/tox.ini index f3ff2d2..467ac0c 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ minversion = 1.8 envlist = py38-lint py38-docs - py{36,37,38,39}-dj{30,31} + py{36,37,38,39}-dj31 py{38,39}-dj{40} py{36,37,38,39}-fl{012,10} py{36,37,38,39}-s{19,20} @@ -24,10 +24,9 @@ setenv = PYTHONPATH = {toxinidir} deps = -rtests/requirements/default.txt - dj{30,31,40}: -rtests/requirements/django.txt + dj{31,40}: -rtests/requirements/django.txt fl{012,10}: -rtests/requirements/flask.txt s{19,20}: -rtests/requirements/sanic.txt - dj30: -ctests/constraints/django-3.0.txt dj31: -ctests/constraints/django-3.1.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt @@ -36,7 +35,7 @@ deps = s20: -ctests/constraints/sanic-20.txt commands = python --version - dj{30,31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} + dj{31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} From ec9ef3362df68cbb02d5cc9e7ca7fb7c3472cb58 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:28:14 -0500 Subject: [PATCH 04/18] Add Python 3.10 Supported by Django 3.2.9 and 4.0. --- .github/workflows/test.yml | 2 +- setup.py | 1 + tox.ini | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e62a68..ce94585 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] # Service containers to run with `container-job` services: diff --git a/setup.py b/setup.py index b5716d3..3d1e29d 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ def read(*parts): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Internet :: WWW/HTTP", ], extras_require={ diff --git a/tox.ini b/tox.ini index 467ac0c..0e44e92 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = py38-lint py38-docs py{36,37,38,39}-dj31 - py{38,39}-dj{40} + py{38,39,310}-dj{40} py{36,37,38,39}-fl{012,10} py{36,37,38,39}-s{19,20} @@ -15,6 +15,7 @@ python = 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [testenv] usedevelop = true From ef4848daf8492306c143699de52e1e0bced42235 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:41:01 -0500 Subject: [PATCH 05/18] Add Django 3.2 Django 3.2 LTS is supported until April 2024. --- setup.py | 1 + tests/constraints/django-3.2.txt | 1 + tox.ini | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 tests/constraints/django-3.2.txt diff --git a/setup.py b/setup.py index 3d1e29d..a4e290c 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ def read(*parts): "Environment :: Web Environment :: Mozilla", "Framework :: Django", "Framework :: Django :: 3.1", + "Framework :: Django :: 3.2", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", diff --git a/tests/constraints/django-3.2.txt b/tests/constraints/django-3.2.txt new file mode 100644 index 0000000..807ac90 --- /dev/null +++ b/tests/constraints/django-3.2.txt @@ -0,0 +1 @@ +Django>=3.2,<4.0 diff --git a/tox.ini b/tox.ini index 0e44e92..37443d5 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ envlist = py38-lint py38-docs py{36,37,38,39}-dj31 + py{36,37,38,39,310}-dj32 py{38,39,310}-dj{40} py{36,37,38,39}-fl{012,10} py{36,37,38,39}-s{19,20} @@ -25,10 +26,11 @@ setenv = PYTHONPATH = {toxinidir} deps = -rtests/requirements/default.txt - dj{31,40}: -rtests/requirements/django.txt + dj{31,32,40}: -rtests/requirements/django.txt fl{012,10}: -rtests/requirements/flask.txt s{19,20}: -rtests/requirements/sanic.txt dj31: -ctests/constraints/django-3.1.txt + dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt fl10: -ctests/constraints/flask-1.0.txt @@ -36,7 +38,7 @@ deps = s20: -ctests/constraints/sanic-20.txt commands = python --version - dj{31,40}: pytest tests/core/ tests/django --nomigrations {posargs:} + dj{31,32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} From a82c5a2e38a7317dbfb497f3d7a995705dd12a8e Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:44:17 -0500 Subject: [PATCH 06/18] Remove Django 3.1 Extended support ended December 2021. --- setup.py | 1 - tests/constraints/django-3.1.txt | 1 - tox.ini | 6 ++---- 3 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 tests/constraints/django-3.1.txt diff --git a/setup.py b/setup.py index a4e290c..cb239c2 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ def read(*parts): "Development Status :: 5 - Production/Stable", "Environment :: Web Environment :: Mozilla", "Framework :: Django", - "Framework :: Django :: 3.1", "Framework :: Django :: 3.2", "Framework :: Flask", "Intended Audience :: Developers", diff --git a/tests/constraints/django-3.1.txt b/tests/constraints/django-3.1.txt deleted file mode 100644 index 36acb6b..0000000 --- a/tests/constraints/django-3.1.txt +++ /dev/null @@ -1 +0,0 @@ -Django>=3.1,<3.2 diff --git a/tox.ini b/tox.ini index 37443d5..a8c2605 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ minversion = 1.8 envlist = py38-lint py38-docs - py{36,37,38,39}-dj31 py{36,37,38,39,310}-dj32 py{38,39,310}-dj{40} py{36,37,38,39}-fl{012,10} @@ -26,10 +25,9 @@ setenv = PYTHONPATH = {toxinidir} deps = -rtests/requirements/default.txt - dj{31,32,40}: -rtests/requirements/django.txt + dj{32,40}: -rtests/requirements/django.txt fl{012,10}: -rtests/requirements/flask.txt s{19,20}: -rtests/requirements/sanic.txt - dj31: -ctests/constraints/django-3.1.txt dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt @@ -38,7 +36,7 @@ deps = s20: -ctests/constraints/sanic-20.txt commands = python --version - dj{31,32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} + dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} From a4677a059ef1e2002f4541fb614cb3d2a6cb1894 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:47:29 -0500 Subject: [PATCH 07/18] Add Django 4.0 classifier to setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index cb239c2..839982b 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ def read(*parts): "Environment :: Web Environment :: Mozilla", "Framework :: Django", "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", From 05c213456bce8d68cfc10ba531d500627708dd32 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:51:30 -0500 Subject: [PATCH 08/18] Drop Sanic 19 Sanic 19.12 support ended, probably December 2021. --- tests/constraints/sanic-19.txt | 1 - tox.ini | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 tests/constraints/sanic-19.txt diff --git a/tests/constraints/sanic-19.txt b/tests/constraints/sanic-19.txt deleted file mode 100644 index e362704..0000000 --- a/tests/constraints/sanic-19.txt +++ /dev/null @@ -1 +0,0 @@ -Sanic<20 diff --git a/tox.ini b/tox.ini index a8c2605..de43e08 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ envlist = py{36,37,38,39,310}-dj32 py{38,39,310}-dj{40} py{36,37,38,39}-fl{012,10} - py{36,37,38,39}-s{19,20} + py{36,37,38,39}-s{20} [gh-actions] python = @@ -27,18 +27,17 @@ deps = -rtests/requirements/default.txt dj{32,40}: -rtests/requirements/django.txt fl{012,10}: -rtests/requirements/flask.txt - s{19,20}: -rtests/requirements/sanic.txt + s{20}: -rtests/requirements/sanic.txt dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt fl10: -ctests/constraints/flask-1.0.txt - s19: -ctests/constraints/sanic-19.txt s20: -ctests/constraints/sanic-20.txt commands = python --version dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} - s{19,20}: pytest tests/core/ tests/sanic/ {posargs:} + s{20}: pytest tests/core/ tests/sanic/ {posargs:} [testenv:py38-docs] basepython = python3.8 From beda73244714c15a9692318dc29f1945643e119f Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 18:58:37 -0500 Subject: [PATCH 09/18] Drop Python 3.6 Python 3.6 reached end-of-life on 2021-12-23, according to PEP 494 --- .github/workflows/test.yml | 2 +- setup.py | 3 +-- tox.ini | 7 +++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce94585..c1f1859 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10'] # Service containers to run with `container-job` services: diff --git a/setup.py b/setup.py index 839982b..4f6c41a 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,6 @@ def read(*parts): "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -48,5 +47,5 @@ def read(*parts): "sanic": ["sanic"], }, zip_safe=False, - python_requires='>=3.6,<4', + python_requires='>=3.7,<4', ) diff --git a/tox.ini b/tox.ini index de43e08..14c4820 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,13 @@ minversion = 1.8 envlist = py38-lint py38-docs - py{36,37,38,39,310}-dj32 + py{37,38,39,310}-dj32 py{38,39,310}-dj{40} - py{36,37,38,39}-fl{012,10} - py{36,37,38,39}-s{20} + py{37,38,39}-fl{012,10} + py{37,38,39}-s{20} [gh-actions] python = - 3.6: py36 3.7: py37 3.8: py38 3.9: py39 From 870f488c118a66d3fa5f7181352f5983268d206a Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 19:31:58 -0500 Subject: [PATCH 10/18] Fix linting --- MANIFEST.in | 2 +- docs/conf.py | 14 +++++++------- pyproject.toml | 2 +- setup.py | 2 +- src/dockerflow/flask/app.py | 2 +- src/dockerflow/sanic/app.py | 2 +- tests/flask/migrations/env.py | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 5837406..bd8e6d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,5 +2,5 @@ recursive-include docs * recursive-include tests * include pytest.ini AUTHORS.rst CODE_OF_CONDUCT.md pyproject.toml LICENSE README.rst tox.ini .coveragerc .isort.cfg prune docs/_build -prune *.pyc +global-exclude *.pyc prune __pycache__ diff --git a/docs/conf.py b/docs/conf.py index aaa3928..b0229d4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,9 +59,9 @@ master_doc = "index" # General information about the project. -project = u"python-dockerflow" -copyright = u"2016, Mozilla Foundation" -author = u"Mozilla Foundation" +project = "python-dockerflow" +copyright = "2016, Mozilla Foundation" +author = "Mozilla Foundation" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -270,8 +270,8 @@ ( master_doc, "python-dockerflow.tex", - u"python-dockerflow Documentation", - u"Mozilla Foundation", + "python-dockerflow Documentation", + "Mozilla Foundation", "manual", ) ] @@ -314,7 +314,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, "python-dockerflow", u"python-dockerflow Documentation", [author], 1) + (master_doc, "python-dockerflow", "python-dockerflow Documentation", [author], 1) ] # If true, show URL addresses after external links. @@ -331,7 +331,7 @@ ( master_doc, "python-dockerflow", - u"python-dockerflow Documentation", + "python-dockerflow Documentation", author, "python-dockerflow", "One line description of project.", diff --git a/pyproject.toml b/pyproject.toml index 58a2691..bfc30ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 88 -target-version = ['py27', 'py36', 'py37'] +target-version = ['py37', 'py38', 'py39', 'py310'] include = '\.pyi?$' exclude = ''' /( diff --git a/setup.py b/setup.py index 4f6c41a..0fbece6 100644 --- a/setup.py +++ b/setup.py @@ -47,5 +47,5 @@ def read(*parts): "sanic": ["sanic"], }, zip_safe=False, - python_requires='>=3.7,<4', + python_requires=">=3.7,<4", ) diff --git a/src/dockerflow/flask/app.py b/src/dockerflow/flask/app.py index 90f6f99..25d467b 100644 --- a/src/dockerflow/flask/app.py +++ b/src/dockerflow/flask/app.py @@ -108,7 +108,7 @@ def __init__( silenced_checks=None, version_path=None, *args, - **kwargs + **kwargs, ): # The Flask blueprint to add the Dockerflow signal callbacks and views self._blueprint = flask.Blueprint("dockerflow", "dockerflow.flask.app") diff --git a/src/dockerflow/sanic/app.py b/src/dockerflow/sanic/app.py index fea87c7..2ef5c02 100644 --- a/src/dockerflow/sanic/app.py +++ b/src/dockerflow/sanic/app.py @@ -82,7 +82,7 @@ def __init__( silenced_checks=None, version_path=".", *args, - **kwargs + **kwargs, ): # The Dockerflow specific logger to be used by internals of this diff --git a/tests/flask/migrations/env.py b/tests/flask/migrations/env.py index fc27f59..b9641bc 100755 --- a/tests/flask/migrations/env.py +++ b/tests/flask/migrations/env.py @@ -76,7 +76,7 @@ def process_revision_directives(context, revision, directives): connection=connection, target_metadata=target_metadata, process_revision_directives=process_revision_directives, - **current_app.extensions["migrate"].configure_args + **current_app.extensions["migrate"].configure_args, ) try: From 63ea3132dd88cde3768898e28246fb6caded4c20 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 19:44:03 -0500 Subject: [PATCH 11/18] Fix Flask 0.12 --- tests/constraints/flask-0.12.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/constraints/flask-0.12.txt b/tests/constraints/flask-0.12.txt index 56bbfb8..6d7ee9e 100644 --- a/tests/constraints/flask-0.12.txt +++ b/tests/constraints/flask-0.12.txt @@ -1,2 +1,4 @@ Flask<0.13 Werkzeug<1.0.0 +Jinja2<3.1 +itsdangerous<2.1.0 From 7383b5e6acb815e38abe8a60a59983d59aa40e58 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 19:49:08 -0500 Subject: [PATCH 12/18] Fix Flask 1.0 --- tests/constraints/flask-1.0.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/constraints/flask-1.0.txt b/tests/constraints/flask-1.0.txt index 22247ca..a7959d0 100644 --- a/tests/constraints/flask-1.0.txt +++ b/tests/constraints/flask-1.0.txt @@ -1 +1,2 @@ Flask<2.0 +MarkupSafe<=2.0.1 From af2c60d5807c2fc1f1661bae31c7eec82e77dc11 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 20:27:07 -0500 Subject: [PATCH 13/18] Test Flask with Python 3.10 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 14c4820..2911494 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py38-docs py{37,38,39,310}-dj32 py{38,39,310}-dj{40} - py{37,38,39}-fl{012,10} + py{37,38,39,310}-fl{012,10} py{37,38,39}-s{20} [gh-actions] From ada316fa1def2ef9bccf4520c3ce714f25c43591 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 20:20:55 -0500 Subject: [PATCH 14/18] Split Flask 1.0 and 1.1 Flask 1.1 was previously tested as Flask 1.0. --- tests/constraints/flask-1.0.txt | 6 ++++-- tests/constraints/flask-1.1.txt | 2 ++ tox.ini | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 tests/constraints/flask-1.1.txt diff --git a/tests/constraints/flask-1.0.txt b/tests/constraints/flask-1.0.txt index a7959d0..b1fe3ec 100644 --- a/tests/constraints/flask-1.0.txt +++ b/tests/constraints/flask-1.0.txt @@ -1,2 +1,4 @@ -Flask<2.0 -MarkupSafe<=2.0.1 +Flask<1.1 +Werkzeug<1.0.0 +Jinja2<3.1 +itsdangerous<2.1.0 diff --git a/tests/constraints/flask-1.1.txt b/tests/constraints/flask-1.1.txt new file mode 100644 index 0000000..91d38d0 --- /dev/null +++ b/tests/constraints/flask-1.1.txt @@ -0,0 +1,2 @@ +Flask<1.2 +MarkupSafe<=2.0.1 diff --git a/tox.ini b/tox.ini index 2911494..efcaddc 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py38-docs py{37,38,39,310}-dj32 py{38,39,310}-dj{40} - py{37,38,39,310}-fl{012,10} + py{37,38,39,310}-fl{012,10,11} py{37,38,39}-s{20} [gh-actions] @@ -25,17 +25,18 @@ setenv = deps = -rtests/requirements/default.txt dj{32,40}: -rtests/requirements/django.txt - fl{012,10}: -rtests/requirements/flask.txt + fl{012,10,11}: -rtests/requirements/flask.txt s{20}: -rtests/requirements/sanic.txt dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt fl10: -ctests/constraints/flask-1.0.txt + fl11: -ctests/constraints/flask-1.1.txt s20: -ctests/constraints/sanic-20.txt commands = python --version dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} - fl{012,10}: pytest tests/core/ tests/flask/ {posargs:} + fl{012,10,11}: pytest tests/core/ tests/flask/ {posargs:} s{20}: pytest tests/core/ tests/sanic/ {posargs:} [testenv:py38-docs] From 93e115048d728a76c9b91c49d41680aa89a5515f Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 20:57:05 -0500 Subject: [PATCH 15/18] Add Flask 2.0 --- tests/constraints/flask-2.0.txt | 2 ++ tox.ini | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 tests/constraints/flask-2.0.txt diff --git a/tests/constraints/flask-2.0.txt b/tests/constraints/flask-2.0.txt new file mode 100644 index 0000000..a6675ab --- /dev/null +++ b/tests/constraints/flask-2.0.txt @@ -0,0 +1,2 @@ +Flask<2.1 +Werkzeug<2.1.0 diff --git a/tox.ini b/tox.ini index efcaddc..5734d1c 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py38-docs py{37,38,39,310}-dj32 py{38,39,310}-dj{40} - py{37,38,39,310}-fl{012,10,11} + py{37,38,39,310}-fl{012,10,11,20} py{37,38,39}-s{20} [gh-actions] @@ -25,18 +25,19 @@ setenv = deps = -rtests/requirements/default.txt dj{32,40}: -rtests/requirements/django.txt - fl{012,10,11}: -rtests/requirements/flask.txt + fl{012,10,11,20}: -rtests/requirements/flask.txt s{20}: -rtests/requirements/sanic.txt dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt fl012: -ctests/constraints/flask-0.12.txt fl10: -ctests/constraints/flask-1.0.txt fl11: -ctests/constraints/flask-1.1.txt + fl20: -ctests/constraints/flask-2.0.txt s20: -ctests/constraints/sanic-20.txt commands = python --version dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} - fl{012,10,11}: pytest tests/core/ tests/flask/ {posargs:} + fl{012,10,11,20}: pytest tests/core/ tests/flask/ {posargs:} s{20}: pytest tests/core/ tests/sanic/ {posargs:} [testenv:py38-docs] From 709930c7481aeb1f044ffdea69881cde6d25f802 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 21:03:04 -0500 Subject: [PATCH 16/18] Add Flask 2.1 --- tests/constraints/flask-2.1.txt | 1 + tox.ini | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 tests/constraints/flask-2.1.txt diff --git a/tests/constraints/flask-2.1.txt b/tests/constraints/flask-2.1.txt new file mode 100644 index 0000000..8402758 --- /dev/null +++ b/tests/constraints/flask-2.1.txt @@ -0,0 +1 @@ +Flask<2.2 diff --git a/tox.ini b/tox.ini index 5734d1c..5c663e8 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = py38-docs py{37,38,39,310}-dj32 py{38,39,310}-dj{40} - py{37,38,39,310}-fl{012,10,11,20} + py{37,38,39,310}-fl{012,10,11,20,21} py{37,38,39}-s{20} [gh-actions] @@ -25,7 +25,7 @@ setenv = deps = -rtests/requirements/default.txt dj{32,40}: -rtests/requirements/django.txt - fl{012,10,11,20}: -rtests/requirements/flask.txt + fl{012,10,11,20,21}: -rtests/requirements/flask.txt s{20}: -rtests/requirements/sanic.txt dj32: -ctests/constraints/django-3.2.txt dj40: -ctests/constraints/django-4.0.txt @@ -33,11 +33,12 @@ deps = fl10: -ctests/constraints/flask-1.0.txt fl11: -ctests/constraints/flask-1.1.txt fl20: -ctests/constraints/flask-2.0.txt + fl21: -ctests/constraints/flask-2.0.txt s20: -ctests/constraints/sanic-20.txt commands = python --version dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:} - fl{012,10,11,20}: pytest tests/core/ tests/flask/ {posargs:} + fl{012,10,11,20,21}: pytest tests/core/ tests/flask/ {posargs:} s{20}: pytest tests/core/ tests/sanic/ {posargs:} [testenv:py38-docs] From ae95ae48db8ce95051cba448d8cadbe587502542 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 22:06:24 -0500 Subject: [PATCH 17/18] Remove Python 2.7 rule --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5c663e8..7f04c32 100644 --- a/tox.ini +++ b/tox.ini @@ -59,5 +59,4 @@ commands = [flake8] exclude = .tox - py27: src/dockerflow/sanic/ ignore=E501,E127,E128,E124 From 605f08a987df01fdc6b249fc77bca8c5334c1cac Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Fri, 8 Jul 2022 22:06:47 -0500 Subject: [PATCH 18/18] Drop Python 2.7 test variant --- tests/core/test_logging.py | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/tests/core/test_logging.py b/tests/core/test_logging.py index 441c28b..1251c3d 100644 --- a/tests/core/test_logging.py +++ b/tests/core/test_logging.py @@ -5,11 +5,9 @@ import logging import logging.config import os -import sys import textwrap import jsonschema -import pytest from dockerflow.logging import JsonLogFormatter @@ -119,10 +117,9 @@ def test_logging_error_tracebacks(caplog): assert "ValueError" in details["Fields"]["traceback"] -@pytest.mark.skipif(sys.version_info < (3, 5), reason="Requires python >= 3.5") -def test_logging_exc_info_false_3x(caplog): +def test_logging_exc_info_false(caplog): """Ensure log formatter does not fail and does not include exception - traceback information when exc_info is False under Python 3.x""" + traceback information when exc_info is False""" try: raise ValueError("\n") except Exception: @@ -135,25 +132,6 @@ def test_logging_exc_info_false_3x(caplog): assert "traceback" not in details["Fields"] -@pytest.mark.skipif(sys.version_info >= (3,), reason="Requires python 2") -def test_logging_exc_info_false_2x(caplog): - """Ensure log formatter does not fail *but* still includes exception - traceback information when exc_info is False under Python 2.x""" - try: - raise ValueError("\n") - except Exception: - logging.exception("there was an error", exc_info=False) - details = assert_records(caplog.records) - - assert details["Severity"] == 3 - assert details["Fields"]["msg"] == "there was an error" - # In Python 2, when exc_info=False is passed, we still see a tuple in the - # formatter, so we still include the error and traceback keys. - assert details["Fields"]["error"].startswith("ValueError('\\n'") - assert details["Fields"]["traceback"].startswith("Uncaught exception:") - assert "ValueError" in details["Fields"]["traceback"] - - def test_ignore_json_message(caplog): """Ensure log formatter ignores messages that are JSON already""" try: