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

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented Oct 17, 2019

@leplatrem leplatrem marked this pull request as ready for review October 17, 2019 10:14
Copy link
Contributor

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

This is missing the fmt param.

@leplatrem
Copy link
Contributor Author

In case this helps, this is the stacktrace of python-dockerflow with Python 3.8:

/home/travis/build/Kinto/kinto/.tox/py38/lib/python3.8/site-packages/dockerflow/logging.py:82: in __init__
    parent_init(self, format, datefmt, style)
/opt/python/3.8.0/lib/python3.8/logging/__init__.py:576: in __init__
    self._style.validate()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <logging.PercentStyle object at 0x7f99c30830a0>
    def validate(self):
        """Validate the input format, ensure it matches the correct style"""
>       if not self.validation_pattern.search(self._fmt):
E       TypeError: expected string or bytes-like object

The fmt parameter should be a string. Here, we don't use this style customization and can leave the default (None).

@leplatrem
Copy link
Contributor Author

The TravisCI job did not apparently... https://travis-ci.org/mozilla-services/python-dockerflow/pull_requests

@leplatrem leplatrem force-pushed the fix-formatter-with-python3.8 branch from 046ad0c to 9a77a36 Compare October 24, 2019 08:51
@codecov-io
Copy link

codecov-io commented Oct 24, 2019

Codecov Report

Merging #38 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #38   +/-   ##
======================================
  Coverage    98.8%   98.8%           
======================================
  Files          19      19           
  Lines         585     585           
  Branches       79      79           
======================================
  Hits          578     578           
  Misses          6       6           
  Partials        1       1
Impacted Files Coverage Δ
src/dockerflow/logging.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74765c5...9a77a36. Read the comment docs.


[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.

@leplatrem leplatrem force-pushed the fix-formatter-with-python3.8 branch from 9a77a36 to 7f7ebe8 Compare October 24, 2019 09:27
@leplatrem leplatrem force-pushed the fix-formatter-with-python3.8 branch from 3c77c75 to e563a5b Compare October 24, 2019 10:07
@leplatrem
Copy link
Contributor Author

Apparently uvloop does not like Python 3.8

   #define CO_OPTIMIZED    0x0001
                           ^
  uvloop/loop.c:334:37: note: in definition of macro ‘__Pyx_PyCode_New’
             PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
                                       ^
  uvloop/loop.c:154727:63: note: in expansion of macro ‘CO_OPTIMIZED’
     __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_uvloop_loop_pyx, __pyx_n_s_callback, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(2, 850, __pyx_L1_error)
                                                                 ^
  In file included from /opt/python/3.8.0/include/python3.8/compile.h:5:0,
                   from /opt/python/3.8.0/include/python3.8/Python.h:138,
                   from uvloop/loop.c:20:
  /opt/python/3.8.0/include/python3.8/code.h:122:28: note: expected ‘PyObject * {aka struct _object *}’ but argument is of type ‘int’
   PyAPI_FUNC(PyCodeObject *) PyCode_New(

@diox
Copy link
Contributor

diox commented Oct 24, 2019

Looks like MagicStack/uvloop#277 (comment)

@jezdez jezdez self-assigned this Oct 25, 2019
@jezdez
Copy link
Contributor

jezdez commented Oct 28, 2019

Closing in favor #39.

@jezdez jezdez closed this Oct 28, 2019
@jezdez
Copy link
Contributor

jezdez commented Oct 28, 2019

dockerflow 2019.10.0 is out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants