fromarkindeximportArkindexClientasBaseArkindexClientclassArkindexClient(BaseArkindexClient):def__init__(*args,**kwargs)->None:# Skip SSL verification in Arkindex API client for local development hostsverify=should_verify_cert(options.get("base_url"))ifnotverify:urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)logger.warn("SSL certificate verification is disabled for Arkindex API calls")super().init(verify=verify,*args,**kwargs)@retry(retry=retry_if_exception(_is_500_error),wait=wait_exponential(multiplier=2,min=3),reraise=True,stop=stop_after_attempt(5),before_sleep=before_sleep_log(logger,logging.INFO),)defrequest(*args,**kwargs):""" Proxy all Arkindex API requests with a retry mechanism in case of 50X errors The same API call will be retried 5 times, with an exponential sleep time going through 3, 4, 8 and 16 seconds of wait between call. If the 5th call still gives a 50x, the exception is re-raised and the caller should catch it Log messages are displayed before sleeping (when at least one exception occurred)"""returnself.request(*args,**kwargs)
And the DEFAULT_CLIENT shoud be defined in your code, not in this lib.
As discussed in Slack, we will be moving retried_request to the API client so that the toolbox does not need to create its own client and works offline. This will remove the _get_arkindex_client method and leave that responsibility up to downstream projects, so no more kwargs either.
Erwan Rouchetchanged title from Support login arguments to Arkindex client to Do not create an Arkindex client on import
changed title from Support login arguments to Arkindex client to Do not create an Arkindex client on import