-
Notifications
You must be signed in to change notification settings - Fork 27
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
FastAPI port of API/Studio, second time around #360
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #360 +/- ##
==========================================
+ Coverage 93.77% 93.84% +0.07%
==========================================
Files 16 16
Lines 2328 2291 -37
Branches 517 516 -1
==========================================
- Hits 2183 2150 -33
+ Misses 82 79 -3
+ Partials 63 62 -1 ☔ View full report in Codecov by Sentry. |
|
Note that fastapi-socketio is really broken, so it would probably be better to not use it: pyropy/fastapi-socketio#52 In the end there's very little actual code in it so we can just use |
Also note that this would mean that the API and Studio require Python 3.8, so not sure if we want to go there... |
The Web API already requires Python 3.8, we only continue to support 3.7 for the programmatic Python API, i.e., g2p as a Python module. |
Ah, of course - then there's no problem since the API is a separate, optional dependency here. But we need to separate the test suites so that we can test the non-API parts with 3.7. |
Also, not quite sure what's going wrong with coverage in CI here, it gives the correct results when I run it locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like these changes, although on my end g2p-studio is broken on this branch, I don't know if I'm doing something wrong or if it's a bug.
I better get my act together and review your hatch PR, but having installed using hatch for this branch I'm already pretty much on-board now.
CI coverage: I don't know what's going on.
I've left notes about the clunky way I've been making sure we're still exercising Python 3.7 in CI. I'm open to better suggestions: the actual goal is that some part of CI should exercise g2p as a Python module and CLI command (i.e., all the tests that don't involve g2p-studio or the REST API) with Python 3.7. I'm not attached to how we get there, just that we do it. And that's a hint that my documentation was sorely inadequate, nothing in there pointed out that goal.
|
||
python run_studio.py | ||
|
||
It does not seem that any equivalents of `routes` or `shell` exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here this is conflating the migration from 1.x to 2.0 and from 2.0 to what will probably have to be 2.1 or possibly even 3.0 if this is not backwards compatible. While I don't think we need a separate migrating to 2.1 file, I think this section should distinguish between migrating to 2.0 (previous text) and to 2.1 new text like you're writing here.
Side note: losing routes
is unfortunate. But I assume there's some other form of auto-generated API documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, there's the auto-generated online API documentation, which is arguably more useful anyway...
I believe this will be ready to merge, with #363 and a redirect link from |
All production API code, and API testing code, requires Python 3.7, but the base g2p CLI and library module still support Python 3.7 and need to be testing in CI.
Meh, I'm being bitten by a stale environment again. I'll create something fresh to test. |
I hate dependency hell! |
Hm, I'm really surprised this is happening ... I didn't have to change anything in my environment, the packages are the same as before the last updates except that we aren't using some of the ones we were previously... |
Found it:
|
aaah ... okay, I put python-socketio>=5 because that's what supports the same protocol as the JavaScript side, but I'll apply this fix (presuming there is no problem with Python 3.8) |
That's the minimum required patch. On a stale environment with
A simpler fix was to install I suppose we could also declare |
Warning: you accidentally undid #365. Maybe we need to make the change in pyproject.toml too. That fixes a prod CVE, so we really want to apply it. |
Oh, oops. This may be due to "git rebase"'s merge conflicts being backwards and hard to understand. |
I don't understand, though ... how did the updated gunicorn dependency disappear from the main branch? |
Alright, finally I can say I agree: we're there! We can merge this. Thank you for your patience working through all the details, and putting up with my stale environments which, while annoying, bring us to express our actual dependencies more accurately, so I don't actually feel bad about it. 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
You almost certainly made a mistake in handling a merge conflict. This is the commit that undoes it:
|
In your defense, merge conflict resolution is indeed quite confusing. I'm quite paranoid about them, often doing extensive reviewing of the commit I'm trying to rebase and the changes that were there before, and not just relying on the conflict resolution tools. |
This time with backwards compatibility and testing! Wow!