Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use self.log.warning instead of warnings.warn #1384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion repo2docker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _platform_default(self):
"""
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."
Expand Down
2 changes: 1 addition & 1 deletion repo2docker/buildpacks/conda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def uses_r(self):
@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,
Expand Down
3 changes: 1 addition & 2 deletions repo2docker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Loading