Skip to content

Fix support of Python 3.8 #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"python": [
"2.7",
"3.6",
"3.7"
"3.7",
"3.8"
],
"cache": "pip",
"install": [
Expand Down
4 changes: 2 additions & 2 deletions src/dockerflow/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def __init__(self, fmt=None, datefmt=None, style="%", logger_name="Dockerflow"):
# positional arguments we have to do a version check here
# to decide whether to pass the style argument or not.
if sys.version_info[:2] < (3, 1):
parent_init(self, format, datefmt)
parent_init(self, fmt, datefmt)
else:
parent_init(self, format, datefmt, style)
parent_init(self, fmt=fmt, datefmt=datefmt, style=style)
self.logger_name = logger_name
self.hostname = socket.gethostname()

Expand Down
13 changes: 7 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
usedevelop = True
minversion = 1.8
envlist =
py36-lint,
py38-lint,
py36-dj{111,21,22}-docs,
# the version matrix according to the Django docs:
# https://docs.djangoproject.com/en/2.0/faq/install/#what-python-version-can-i-use-with-django
py{27,36}-dj111-tests,
py{36,37}-dj{21,22}-tests,
py{27,36}-fl{011,012,10}-tests,
py{36,37}-s19-tests,
py{36,37,38}-dj{21,22}-tests,
py{27,36,37,38}-fl{011,012,10}-tests,
py{36,37,38}-s19-tests,

[testenv]
basepython =
py27: python2.7
py36: python3.6
py37: python3.7
py38: python3.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: maybe we should also consider changing [testenv:py36-lint] below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as tests-py{27,34}: PYTEST_ADDOPTS = --ignore=tests/test_sanic.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as tests-py{27,34}: PYTEST_ADDOPTS = --ignore=tests/test_sanic.py

In this one we're telling to ignore sanic tests on python < 3.5. I think it's ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah sorry read that too quickly

Copy link
Contributor

@jezdez jezdez Oct 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, woops I've been doing those changes locally as well but ran against some issues with the test setup. Will incorporate your changes.

usedevelop = true
setenv =
DJANGO_SETTINGS_MODULE = tests.settings
Expand All @@ -36,8 +37,8 @@ commands =
tests: pytest {posargs:tests}
docs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

[testenv:py36-lint]
basepython = python3.6
[testenv:py38-lint]
basepython = python3.8
deps =
flake8
flake8-black
Expand Down