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.
feat: python rtl optional config ApiSettings init parameter #996
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
feat: python rtl optional config ApiSettings init parameter #996
Changes from 2 commits
79017c3
348fa80
354f78d
a004173
ae33294
3e24d6a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Now that we're using
typing_extensions
forRequired
and it's not available till 3.11(?) we need to update this and setup.py (and we should specify the minimum version of typing_extensions to use)starting to get a little unwieldy - I've seen other libraries consolidate into a
_compat.py
library to do all this. But for now I think we're ok leaving it inline here.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 tried with 3.11.0a4 but
Required
wasn't in there.So I've
typing_extensions
I think that is the best way? Note we still can't use 3.11 anyway because of #944 (I pulled Required from typing_extensions running 3.11 and got the error referenced in that issue).
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.
Required
is a relatively recent addition totyping_extensions
, looks like about 3 months ago.pyright support is there which is nice..
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.
cool! I'm approving action runs so we can see how this goes on all the python versions we support
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.
base_url
is technically not required. It's required to be an instance property on the settings object and the default implementation gets it fromread_config
but that's not required. I know it's confusing - honestly the only reasonread_config
exists is so that our default implementation doesn't have to storeclient_id
orclient_secret
in python memory for security purposes. Otherwise they'd just be required instance properties too and there would be noread_config
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've added the type here and my editor was happy with it. Adding it to
read_config
would probably require further code changes, probably not worth 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.
let's see how the mypy and unittest runs go. If
TypeDict.Required
is available on all our supported python versions then it actually would be nice (actually probably required) to update the default implementation's type signature