Fix package identification for scikit-image

This commit is contained in:
Alex Burlacu 2023-05-25 17:41:35 +03:00
parent 14351e9f93
commit 813777a4cc
2 changed files with 20 additions and 8 deletions

View File

@ -277,15 +277,11 @@ class Session(TokenManager):
return list(retry_codes)
def _load_vaults(self):
# () -> Optional[bool]
def _read_vaults(self):
# () -> Optional[dict]
if not self.check_min_api_version("2.15") or self.feature_set == "basic":
return
if ENV_DISABLE_VAULT_SUPPORT.get():
# (self._logger or get_logger()).debug("Vault support is disabled")
return
def parse(vault):
# noinspection PyBroadException
try:
@ -306,13 +302,23 @@ class Session(TokenManager):
vaults = res.json().get("data", {}).get("vaults", [])
data = list(filter(None, map(parse, vaults)))
if data:
self.config.set_overrides(*data)
return True
return data
elif res.status_code != 404:
raise Exception(res.json().get("meta", {}).get("result_msg", res.text))
except Exception as ex:
(self._logger or get_logger()).warning("Failed getting vaults: {}".format(ex))
def _load_vaults(self):
# () -> Optional[bool]
if ENV_DISABLE_VAULT_SUPPORT.get():
# (self._logger or get_logger()).debug("Vault support is disabled")
return
data = self._read_vaults()
if data:
self.config.set_overrides(*data)
return True
def _apply_config_sections(self, local_logger):
# type: (_LocalLogger) -> None # noqa: F821
default = self.config.get("sdk.apply_environment", False)

View File

@ -91,6 +91,12 @@ class ScriptRequirements(object):
for fname, lines in sklearn.items():
modules.add('scikit_learn', fname, lines)
# bugfix, replace sklearn with scikit-learn name
if 'skimage' in modules:
skimage = modules.pop('skimage', {})
for fname, lines in skimage.items():
modules.add('scikit_image', fname, lines)
# if we have torch and it supports tensorboard, we should add that as well
# (because it will not be detected automatically)
if 'torch' in modules and 'tensorboard' not in modules and 'tensorboardX' not in modules: