Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']

# Service containers to run with `container-job`
services:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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__
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -270,8 +270,8 @@
(
master_doc,
"python-dockerflow.tex",
u"python-dockerflow Documentation",
u"Mozilla Foundation",
"python-dockerflow Documentation",
"Mozilla Foundation",
"manual",
)
]
Expand Down Expand Up @@ -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.
Expand All @@ -331,7 +331,7 @@
(
master_doc,
"python-dockerflow",
u"python-dockerflow Documentation",
"python-dockerflow Documentation",
author,
"python-dockerflow",
"One line description of project.",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 88
target-version = ['py27', 'py36', 'py37']
target-version = ['py37', 'py38', 'py39', 'py310']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ 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 :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"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",
"Programming Language :: Python :: 3.10",
"Topic :: Internet :: WWW/HTTP",
],
extras_require={
Expand All @@ -48,5 +47,5 @@ def read(*parts):
"sanic": ["sanic"],
},
zip_safe=False,
python_requires='>=3.6,<4',
python_requires=">=3.7,<4",
)
2 changes: 1 addition & 1 deletion src/dockerflow/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/dockerflow/sanic/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/constraints/django-2.2.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/constraints/django-3.0.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/constraints/django-3.1.txt

This file was deleted.

1 change: 1 addition & 0 deletions tests/constraints/django-3.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Django>=3.2,<4.0
2 changes: 0 additions & 2 deletions tests/constraints/flask-0.11.txt

This file was deleted.

2 changes: 2 additions & 0 deletions tests/constraints/flask-0.12.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Flask<0.13
Werkzeug<1.0.0
Jinja2<3.1
itsdangerous<2.1.0
5 changes: 4 additions & 1 deletion tests/constraints/flask-1.0.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Flask<2.0
Flask<1.1
Werkzeug<1.0.0
Jinja2<3.1
itsdangerous<2.1.0
2 changes: 2 additions & 0 deletions tests/constraints/flask-1.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flask<1.2
MarkupSafe<=2.0.1
2 changes: 2 additions & 0 deletions tests/constraints/flask-2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flask<2.1
Werkzeug<2.1.0
1 change: 1 addition & 0 deletions tests/constraints/flask-2.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask<2.2
1 change: 0 additions & 1 deletion tests/constraints/sanic-19.txt

This file was deleted.

26 changes: 2 additions & 24 deletions tests/core/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import logging
import logging.config
import os
import sys
import textwrap

import jsonschema
import pytest

from dockerflow.logging import JsonLogFormatter

Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/flask/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
32 changes: 15 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ minversion = 1.8
envlist =
py38-lint
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}-s{19,20}
py{37,38,39,310}-dj32
py{38,39,310}-dj{40}
py{37,38,39,310}-fl{012,10,11,20,21}
py{37,38,39}-s{20}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
usedevelop = true
Expand All @@ -24,23 +24,22 @@ setenv =
PYTHONPATH = {toxinidir}
deps =
-rtests/requirements/default.txt
dj{22,30,31,40}: -rtests/requirements/django.txt
fl{011,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
dj{32,40}: -rtests/requirements/django.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
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
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{22,30,31,40}: pytest tests/core/ tests/django --nomigrations {posargs:}
fl{011,012,10}: pytest tests/core/ tests/flask/ {posargs:}
s{19,20}: pytest tests/core/ tests/sanic/ {posargs:}
dj{32,40}: pytest tests/core/ tests/django --nomigrations {posargs:}
fl{012,10,11,20,21}: pytest tests/core/ tests/flask/ {posargs:}
s{20}: pytest tests/core/ tests/sanic/ {posargs:}

[testenv:py38-docs]
basepython = python3.8
Expand All @@ -60,5 +59,4 @@ commands =
[flake8]
exclude =
.tox
py27: src/dockerflow/sanic/
ignore=E501,E127,E128,E124