kopia lustrzana https://github.com/jupyterhub/repo2docker
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
rodzic
b7c151536d
commit
025277d5a6
|
@ -267,7 +267,7 @@ class Repo2Docker(Application):
|
||||||
"""
|
"""
|
||||||
p = get_platform()
|
p = get_platform()
|
||||||
if p == "linux/arm64":
|
if p == "linux/arm64":
|
||||||
warnings.warn(
|
self.log.warning(
|
||||||
"Building for linux/arm64 is experimental. "
|
"Building for linux/arm64 is experimental. "
|
||||||
"To use the recommended platform set --Repo2Docker.platform=linux/amd64. "
|
"To use the recommended platform set --Repo2Docker.platform=linux/amd64. "
|
||||||
"To silence this warning set --Repo2Docker.platform=linux/arm64."
|
"To silence this warning set --Repo2Docker.platform=linux/arm64."
|
||||||
|
|
|
@ -355,7 +355,7 @@ class CondaBuildPack(BaseImage):
|
||||||
@property
|
@property
|
||||||
def py2(self):
|
def py2(self):
|
||||||
"""Am I building a Python 2 kernel environment?"""
|
"""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.",
|
"CondaBuildPack.py2 is deprecated in 2023.2. Use CondaBuildPack.separate_kernel_env.",
|
||||||
DeprecationWarning,
|
DeprecationWarning,
|
||||||
stacklevel=2,
|
stacklevel=2,
|
||||||
|
|
|
@ -543,5 +543,4 @@ def get_platform():
|
||||||
# OSX reports arm64
|
# OSX reports arm64
|
||||||
return "linux/arm64"
|
return "linux/arm64"
|
||||||
else:
|
else:
|
||||||
warnings.warn(f"Unexpected platform '{m}', defaulting to linux/amd64")
|
raise ValueError("Unsupported platform {m}")
|
||||||
return "linux/amd64"
|
|
||||||
|
|
Ładowanie…
Reference in New Issue