mozilla-services / python-dockerflow

A Python package to implement tools and helpers for Mozilla Dockerflow
https://python-dockerflow.readthedocs.io
Mozilla Public License 2.0
38 stars 21 forks source link

Support Sanic 21 and later #70

Closed jwhitlock closed 2 years ago

jwhitlock commented 2 years ago

Sanic 21.12 will require changes in tests, and possibly in code.

Sanic 21.3 moved testing support from sanic.testing to a new module sanic-testing. This will require a different requirements file than Sanic 20.x to install sanic-testing.

There are other changes needed to support sanic-testing, such as changes to app registration and the test client. The changes are large enough that a new test file may be useful, rather than dynamically changing code based on the version.

There may be other changes in the framework itself. For example, this test:

https://github.com/mozilla-services/python-dockerflow/blob/5e30d692664f1831289ba52158a19fc38ed3a22f/tests/sanic/test_sanic.py#L98-L99

fails with AttributeError: 'Router' object has no attribute 'routes_names'.

Currently, tests pass for Sanic 20.12.3, which is supported until December 2022. After this date, if we don't support Sanic 21.12, then we may want to drop Sanic support entirely.

jwhitlock commented 2 years ago

@relud - do you have time and interest to work on this?

relud commented 2 years ago

i'll try to make time to fix this up when i return from vacation next week