Skip to content

Commit

Permalink
Reinitializes plugin settings in reset_context (conda#14480)
Browse files Browse the repository at this point in the history
* adding a reload step in the reset_context funciton

* using a method which invalidates the cache rather than reloads the settings
  • Loading branch information
travishathaway authored Jan 10, 2025
1 parent 45a6fdd commit 6acf4a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conda/base/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys
from collections import defaultdict
from collections.abc import Mapping
from contextlib import contextmanager
from contextlib import contextmanager, suppress
from errno import ENOENT
from functools import cache, cached_property
from itertools import chain
Expand Down Expand Up @@ -1908,7 +1908,7 @@ def description_map(self):
def reset_context(search_path=SEARCH_PATH, argparse_args=None):
global context

# reset plugin config params
# remove plugin config params
remove_all_plugin_settings()

context.__init__(search_path, argparse_args)
Expand All @@ -1922,6 +1922,10 @@ def reset_context(search_path=SEARCH_PATH, argparse_args=None):
# clear function cache
from ..reporters import _get_render_func

# reload plugin config params
with suppress(AttributeError):
del context.plugins

_get_render_func.cache_clear()

return context
Expand Down

0 comments on commit 6acf4a3

Please sign in to comment.