Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Python3.7 compatibility for mocurly#1

Merged
pgrzesik merged 3 commits intomasterfrom
python3.7-compatibility
May 7, 2020
Merged

Python3.7 compatibility for mocurly#1
pgrzesik merged 3 commits intomasterfrom
python3.7-compatibility

Conversation

@pgrzesik
Copy link

Changes with reasoning:

  • We had to update httpretty because previous version did not support Python3.7
  • We had to update recurly because previous versions did not support Python3.7
  • We had to add an additional dependency, iso8601
  • We had to change the behavior for timeout simulation due to changes in httpretty. Related issue Fix compatibility with later versions of httpretty Captricity/mocurly#13. I chose the version with just returning 502, which to be fair, makes way more sense to me than indicating timeouts via SSLError. I checked in our codebase and it seems like we're not using that at all, but it's worth remembering as someone might get caught by that.

Upgrade HTTPretty to version that supports Python3.7
Upgrade Recurly to version that supports Python3.7
Change the way timeout is simulated - return error instead of raising ssl.SSLError
@pgrzesik
Copy link
Author

I ran the tests for both 3.7 and 3.6 and they work just fine 💯

@pgrzesik pgrzesik requested review from caleb15 and koliber April 27, 2020 09:47
Copy link

@koliber koliber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

This change bumps our version of the recurly lib, which is core to our billing integration. Please WIP this PR until the PPP squad can do regression testing on this new version.

httpretty>=0.8,<=0.8.10
recurly>=2.2.23
httpretty>=0.9.4
recurly>=2.9.0,<3.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require regression testing in the @15five/provisioning-payment-squad . We'll need to get a ticket set up for that.

@koliber koliber changed the title Python3.7 compatibility for mocurly WIP: Python3.7 compatibility for mocurly Apr 27, 2020
@koliber
Copy link

koliber commented Apr 27, 2020

WIPed until @15five/provisioning-payment-squad tests the new version of the recurly lib.

@pgrzesik
Copy link
Author

@koliber Thanks 🙇 FYI I remember doing regression testing on 2.8.6 and all was fine, definitely we don't want to go above 3.0.0 as it's introducing another version of API.

@koliber
Copy link

koliber commented Apr 27, 2020

I created https://15five-dev.atlassian.net/browse/ENG-9441 to do more in-depth billing testing. Is 2.8.6 the minimal we need to go to? The mocurle requirements state 2.9. Please update https://15five-dev.atlassian.net/browse/ENG-9441 to communicate the lowest version that is required for python 2.7.

@pgrzesik
Copy link
Author

@koliber sorry for not being specific - I tested the 2.8.6 when I was implementing support for custom fields in Recurly a while back. For this, we need at least 2.9.0, but the best would be to go with the most recent 2.9.x version. I will update the ticket.

Copy link

@caleb15 caleb15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a nitpick regarding iso8601, fix that and you are 👍 to merge

I tested your changes w/ python 3.6 and 3.7 and it works in both

@pgrzesik pgrzesik force-pushed the python3.7-compatibility branch from 2fe4c49 to cb2bf8b Compare April 27, 2020 17:59
@nballenger
Copy link

I put in a PR here:

https://github.com/15five/fifteen5/pull/28358

that makes one change to PPP code necessary to move to recurly 2.9.16. It's got notes on my test process--if I've missed anything obvious I'm hoping the review will pick them up.

@pgrzesik
Copy link
Author

pgrzesik commented May 7, 2020

As the tests were successfull, I'm merging this one

@pgrzesik pgrzesik changed the title WIP: Python3.7 compatibility for mocurly Python3.7 compatibility for mocurly May 7, 2020
@pgrzesik pgrzesik merged commit f5aa444 into master May 7, 2020
@pgrzesik pgrzesik deleted the python3.7-compatibility branch May 7, 2020 10:29
@caleb15
Copy link

caleb15 commented May 7, 2020

Is it okay if we open-source this and submit a PR to Captricity#21?

@pgrzesik
Copy link
Author

pgrzesik commented May 7, 2020

@caleb15 I would love to - the only thing I worry about is the fact that it kinda breaks/changes the approach on one of their functionalities (simulating the timeouts) - I'm not sure if they have docs but we should probably also update them if possible afterwards.

cc @koliber what do you think about us providing a PR to mocurly?

@caleb15
Copy link

caleb15 commented May 8, 2020

I updated https://github.com/15five/fifteen5/pull/27702 to use the new mocurly code and the python tests are passing now! :D

https://circleci.com/gh/15five/fifteen5/162673

I've also deployed the new code to cloud51 https://circleci.com/workflow-run/86924c3b-acf7-4acc-bab5-75d08b973522

@koliber
Copy link

koliber commented Jun 2, 2020

I think it's a great idea to provide a PR with this update to mocurly.

I somehow missed this thread. Apologies for replying so late. Thank you @caleb15 for drawing my attention back in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants