alan-turing-institute / DTBase

A starting point from which digital twins can be developed.
MIT License
11 stars 4 forks source link

Migrate backend from Flask to FastAPI #207

Closed mhauru closed 6 months ago

mhauru commented 6 months ago

Changes in this PR:

Benefits of this switch:

Downsides of this switch:

Things not done in this PR, but that we may want to do in the future. None of these are urgent though, so not going to get to them immediately:

Closes #167

mhauru commented 6 months ago

The tests fail because of some datetime parsing issue, I'm pretty sure they pass on python 3.11 (they do locally). I'll fix it tomorrow.

EdwinB12 commented 6 months ago

Interesting, I had this yesterday. Test fails on one of them and then cancels it on python runs. Rerunning the tests through the github gui seems to work

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 97.05628% with 34 lines in your changes are missing coverage. Please review.

Project coverage is 89.65%. Comparing base (38cbdc6) to head (ba20199).

:exclamation: Current head ba20199 differs from pull request most recent head c1cc874. Consider uploading reports for the commit c1cc874 to get more accurate results

Files Patch % Lines
dtbase/backend/auth.py 84.78% 7 Missing :warning:
dtbase/backend/api/sensor/routes.py 95.28% 5 Missing :warning:
dtbase/backend/db.py 83.33% 4 Missing :warning:
dtbase/tests/conftest.py 91.66% 4 Missing :warning:
dtbase/tests/test_api_models.py 98.13% 3 Missing :warning:
dtbase/backend/api/location/routes.py 97.61% 2 Missing :warning:
dtbase/backend/api/model/routes.py 98.23% 2 Missing :warning:
dtbase/tests/test_api_sensors.py 98.29% 2 Missing :warning:
dtbase/tests/test_api_user.py 96.22% 2 Missing :warning:
dtbase/core/db.py 87.50% 1 Missing :warning:
... and 2 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #207 +/- ## ========================================== + Coverage 89.44% 89.65% +0.21% ========================================== Files 76 72 -4 Lines 5287 5116 -171 ========================================== - Hits 4729 4587 -142 + Misses 558 529 -29 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mhauru commented 6 months ago

Thanks for the speedy review Edwin. I'll merge once tests pass. @GiorgioCerro, feel free to still leave comments if you want to, we can always make post-merge changes.