Closed chr1st1ank closed 3 years ago
wow, will take a deep look soon!
@bobbui, as I wrote above your comment made me aware that the fastapi implementation always imported fastapi
and its basis starlette
. That's probably not what we want for non-web users or for users of different frameworks.
So I changed this by putting the implementation in a separate module which is only imported if fastapi is available.
In order to guarantee that such things are caught by the tests in the future I added another test suite which runs all the examples from the README file in a minimal environment for the respective backend. E.g. the flask backend is only run in an environment with "flask" and the test tooling in it. That's the reason why I had to make it a separte job in the github action workflow. A more elegant solution did not come to my mind. Additional benefit of these tests is that they guarantee that the README examples at least not crash immediately. Please take a look if you like this setup.
@bobbui, as I wrote above your comment made me aware that the fastapi implementation always imported
fastapi
and its basisstarlette
. That's probably not what we want for non-web users or for users of different frameworks. So I changed this by putting the implementation in a separate module which is only imported if fastapi is available.In order to guarantee that such things are caught by the tests in the future I added another test suite which runs all the examples from the README file in a minimal environment for the respective backend. E.g. the flask backend is only run in an environment with "flask" and the test tooling in it. That's the reason why I had to make it a separte job in the github action workflow. A more elegant solution did not come to my mind. Additional benefit of these tests is that they guarantee that the README examples at least not crash immediately. Please take a look if you like this setup.
Its should be ok that way even though a bit undesirable. The integration test approach is sound, if we can somehow run each sample in a minimal isolated environment, e.g: Flask sample only run with Python virtualenv with only Flask installed. That would be really great.
Its should be ok that way even though a bit undesirable. The integration test approach is sound, if we can somehow run each sample in a minimal isolated environment, e.g: Flask sample only run with Python virtualenv with only Flask installed. That would be really great.
That's just what I implemented in .github/workflows/code_quality.yml
. It installs these minimal environments for each of these smoketests.
released 1.3.0
This PR adds a backend for Fastapi including tests and example.
In the first commits there are also fixes for