Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Make
mypy supabasepass with no errors in a weak ruleset. Also enforce the same ruff linting rules asauth, in order to catch missing annotations and unused variables/imports (currently, onlyauthhas these, I still intend to enforce this workspace wide in the future).Additional context
There was a small bug related to
SyncGoTrueAPI.__exit__I fixed in the middle of this PR. Specifically, theAsyncGoTrueAPIhas aclosemethod that callsself.httpx_client.aclose()internally, but that method does not exist on the sync version, so instead of patching in on thebuild-synccommand, it instead created a customSyncClientclass specific forauth, which added anaclosemethod.However,
supabasedoes not care to use thisSyncClientclass when anhttpx_clientargument is passed in (which is a type error), which means that if the__exit__method is called, it throws an error. Eg. if a user used thesyncversion with a customhttpx_clientand uses awithblock, it throws an error:throws:
Goes to show the importance of type checking your code! The fix for this was to remove this class and manually patch
acloseto translate tocloseinauth/scripts/run-async.py.