-
Notifications
You must be signed in to change notification settings - Fork 388
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
For custom cassette persisters no longer catch ValueError #681
Conversation
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.
@amosjyng I see how this change could help on an abstract level. Could you elaborate what concrete practical problem this is fixing for you? What made you want to change this code? Thank in advance! 🙏
IIRC I was trying to save different keys to the recorded file, but |
Hi @amosjyng, thanks for elaborating! I just found that the documentation at https://vcrpy.readthedocs.io/en/latest/advanced.html#register-your-own-cassette-persister says that…
I think that means that changing So we probably need to clarify that first — @jairhenrique @kevin1024 what do you think, does this break the API? Best, Sebastian Notes to self for later:
|
My guess is that most folks have not built their own persister, so it should only affect a minority of vcrpy users. Has anyone built their own persister? Honestly IIRC I just thought it was a cool idea for someone to store cassettes in a database or s3 or something but I haven't heard of anyone using it. |
@kevin1024 to be sure I read (2) right: You're pro fixing this and the major version bump? |
Yeah, but this single change alone probably isn’t worth releasing a version bump in and of itself. Maybe we can batch it up with some other breaking changes like dropping older models python versions and/or old http library versions and do a major bump sometime in the future. What do you think? |
@kevin1024 if we go the collect-more-breakage route, we either need a second master branch or we lose instant releasability on the master branch. The latter is a clear non-option to me and former is probably overkill and may hold this for later for an unclear amount of time. Given that the breakage is easy to adjust to, will likely not affect most users (as you mentioned), and will likely show directly where used in the test suite, I would vote for the simple approach and just treat this like a normal pull request except with bumping the version to 5.0.0, and continue as usual. If you like, we can merge #695 dropping Python 3.7 right after and call that the release, if you feel it's in the breaking bucket (— personally, I don't see it as breaking but it can be argued). What do you think? |
Excellent points, all! I agree with your plan. The only thing this PR needs still is an update to the documentation to mention the new API (different exception) |
@kevin1024 cool!
Yes! I believe in total (integrating my earlier todo-notes from #681 (comment) above) we need:
@amosjyng @kevin1024 what do you think? PS: I can help out with any of these parts as needed. |
Sounds great to me! There's no rush on my end, we can wait for whenever the next major version is due. I just opened this PR as a suggestion to hopefully save others in the future some time :) |
@amosjyng any news on the implementation? |
I had to spend some time digging before I realized that serialization/deserialization errors were being swallowed here
0dd7ca9
to
12d44d7
Compare
Sorry, I thought you guys were talking to each other about making those changes, not to me :P I've split it into |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #681 +/- ##
==========================================
- Coverage 90.30% 90.26% -0.04%
==========================================
Files 28 28
Lines 1774 1778 +4
Branches 313 313
==========================================
+ Hits 1602 1605 +3
- Misses 137 138 +1
Partials 35 35
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
@amosjyng thanks for this, looking pretty good already, nice! 👍
I was wondering whether UnicodeEncodeError
should actually be UnicodeDecodeError
instead also — by now I think it's indeed mixed up. Please see my comments on details below:
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.
@amosjyng thanks for the adjustments, looks great! 👍
I have some hope that @kevin1024 is with me on releasing 4.4.0 shortly before the merge (i.e. issue #724). Let's see what he thinks; approving the pull request now…
@amosjyng you probably saw https://github.com/kevin1024/vcrpy/releases/tag/v5.0.0 but… your documentation changes are also live at https://vcrpy.readthedocs.io/en/latest/advanced.html#register-your-own-cassette-persister now. Thanks again! 🙏 |
Woohooo, that's cool to see! Thanks @hartwork ! :) |
I had to spend some time digging before I realized that serialization/deserialization errors were being swallowed here