IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

feat(BaseService): Use a `requests.Session` object to configure retries and other configuration #101

Closed rmkeezer closed 3 years ago

rmkeezer commented 3 years ago

Closes #83

Updated from https://github.com/IBM/python-sdk-core/pull/84

codecov[bot] commented 3 years ago

Codecov Report

Merging #101 (a9e4806) into master (dcb1ad3) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
+ Coverage   98.19%   98.21%   +0.01%     
==========================================
  Files          18       18              
  Lines         665      672       +7     
==========================================
+ Hits          653      660       +7     
  Misses         12       12              
Impacted Files Coverage Δ
ibm_cloud_sdk_core/base_service.py 95.32% <100.00%> (+0.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dcb1ad3...a9e4806. Read the comment docs.

rmkeezer commented 3 years ago
  1. I added a get_http_client and set_http_client method but you can also set the base_service.http_client directly if necessary
  2. It shouldn't affect disable_ssl_verification since the flag is passed into the request kwargs during the prepare_request() function so even if the user sets their own http_client, the flag will be passed into that session during a request
  3. That's a good idea and I opened an issue here to add retry logic to the core here: https://github.ibm.com/arf/planning-sdk-squad/issues/2444 I believe this should not be difficult for python since the requests library and the urllib3 library do a lot of heavy lifting with retry logic configuration, the option just needs to be added to pass down config parameters.
ibm-devx-automation commented 3 years ago

:tada: This PR is included in version 3.5.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: