From 3d5c6203a0b56a4436805d0fbd8a8fd84306594a Mon Sep 17 00:00:00 2001 From: Klaus Zimmermann Date: Tue, 11 Jun 2024 10:52:46 +0200 Subject: [PATCH] Replace logger.warn w/ logger.warning (#476) * Ruff corrections G010 * Correct comment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- conda_libmamba_solver/conda_build_exceptions.py | 2 +- conda_libmamba_solver/index.py | 4 +++- conda_libmamba_solver/solver.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conda_libmamba_solver/conda_build_exceptions.py b/conda_libmamba_solver/conda_build_exceptions.py index 915c64d1..64088f72 100644 --- a/conda_libmamba_solver/conda_build_exceptions.py +++ b/conda_libmamba_solver/conda_build_exceptions.py @@ -25,6 +25,6 @@ def __init__(self, matchspecs=None, explanation=None, *args, **kwargs): def __str__(self) -> str: msg = self.message if not self.explanation: - # print simple message in log.warn() calls + # print simple message in log.warning() calls return msg return "\n".join([msg, self.explanation]) diff --git a/conda_libmamba_solver/index.py b/conda_libmamba_solver/index.py index c26e36b2..4c5ca00c 100644 --- a/conda_libmamba_solver/index.py +++ b/conda_libmamba_solver/index.py @@ -278,7 +278,9 @@ def _json_path_to_repo_info( solv_stat = None if solv_stat is None and json_stat is None: - log.warn("No repodata found for channel %s. Solve will fail.", channel.canonical_name) + log.warning( + "No repodata found for channel %s. Solve will fail.", channel.canonical_name + ) return if solv_stat is None: path_to_use = json_path diff --git a/conda_libmamba_solver/solver.py b/conda_libmamba_solver/solver.py index 20025c2d..44293d50 100644 --- a/conda_libmamba_solver/solver.py +++ b/conda_libmamba_solver/solver.py @@ -829,7 +829,7 @@ def _export_solved_records( out_state.records.pop(name, None) break else: - log.warn("Tried to unlink %s but it is not installed or manageable?", filename) + log.warning("Tried to unlink %s but it is not installed or manageable?", filename) for_conda_build = self._called_from_conda_build() for channel, filename, json_payload in to_link: