-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Change from_dict from staticmethod to classmethod BNCH-17564 #23
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
Conversation
@packyg I could use some help understanding how all this works-- Should I be submitting a PR against the upstream original repo at the same time? Are the e2e tests sufficient, or are there unit tests I should be updating? |
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.
Yeah, you should upstream this. It might be better to only upstreaming this and then we pick up the changes when we rebase next.
To do that I'd start from the main
branch of upstream and cherry pick your change, then make an upstream PR with that (noting that it fixes openapi-generators#215). The upstream maintainer is pretty responsive so would probably be pretty quick to incorporate the change. We could then work with @bowenwr to pull it in when he gets back.
The e2e tests are going to be the right way to check this. There's 2 different codegens that should happen - it looks like you did both of them, but I just want to make sure you did it with poetry run task re
Also, you can run poetry run task check
to do all of the static code checks (isort
/black
/mypy
) and pytest
.
@@ -1,6 +1,6 @@ | |||
[tool.poetry] | |||
name = "openapi-python-client" | |||
version = "0.7.3" | |||
version = "0.7.4" |
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.
We don't own this version number - even if we weren't upstreaming this change, we should leave it so we don't have conflicts later when we rebase or fork
version = "0.7.4" | |
version = "0.7.3" |
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.
Aside from Packy's existing comments, this looks great. I agree, I'd love to get it upstreamed so we can pull it in. Excellent work @forest-benchling !
@packyg I'm still a bit confused to do this. It looks like I don't have permission to push to the upstream |
@forest-benchling No we don't, but you could just do it in our repo, based on the upstream git remote add -m main upstream git@github.com:triaxtec/openapi-python-client.git
git fetch --all
git checkout -b my-branch upstream/main
git cherry-pick ...
Yes, that's what you'll have to do - create the branch in our repo, but make a PR against the upstream by changing the merge base to An example of one of the PRs I made from our repo to the upstream can be found here: openapi-generators#268 (though that PR wasn't ultimately used b/c the maintainer wanted to tweak it a bit while we were off for winter) |
This allows
from_dict
to be inherited and overridden by subclasses. I couldn't think of any scenarios where this would be a breaking change, unless someone was relying on incorrect subclass inheritance.The only relevant changes are
model.pyi
andpyproject.toml
. The rest of the files are from regenerating thee2e
test.Test Plan
poetry run mypy ~/openapi-python-client/end_to_end_tests/golden-record-custom/custom_e2e/models/