Use self.log.warning instead of warnings.warn

warnings.warn sidesteps all the json logging bits we do,
and repo2docker will produce non-json output that binderhub
then struggles to consume.
pull/1384/head
YuviPanda 2024-12-08 00:22:51 -08:00
rodzic b7c151536d
commit 025277d5a6
3 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -267,7 +267,7 @@ class Repo2Docker(Application):
"""
p = get_platform()
if p == "linux/arm64":
warnings.warn(
self.log.warning(
"Building for linux/arm64 is experimental. "
"To use the recommended platform set --Repo2Docker.platform=linux/amd64. "
"To silence this warning set --Repo2Docker.platform=linux/arm64."

Wyświetl plik

@ -355,7 +355,7 @@ class CondaBuildPack(BaseImage):
@property
def py2(self):
"""Am I building a Python 2 kernel environment?"""
warnings.warn(
self.log.warning(
"CondaBuildPack.py2 is deprecated in 2023.2. Use CondaBuildPack.separate_kernel_env.",
DeprecationWarning,
stacklevel=2,

Wyświetl plik

@ -543,5 +543,4 @@ def get_platform():
# OSX reports arm64
return "linux/arm64"
else:
warnings.warn(f"Unexpected platform '{m}', defaulting to linux/amd64")
return "linux/amd64"
raise ValueError("Unsupported platform {m}")