MCPcopy
hub / github.com/conda/conda / reset_context

Function reset_context

conda/base/context.py:2062–2091  ·  view source on GitHub ↗
(
    search_path: PathsType = SEARCH_PATH,
    argparse_args: Namespace | None = None,
)

Source from the content-addressed store, hash-verified

2060
2061
2062def reset_context(
2063 search_path: PathsType = SEARCH_PATH,
2064 argparse_args: Namespace | None = None,
2065) -> Context:
2066 global context
2067
2068 # remove plugin config params
2069 from ..plugins.config import PluginConfig
2070
2071 PluginConfig.remove_all_plugin_settings()
2072
2073 YamlRawParameter.cache_clear()
2074 context.__init__(search_path, argparse_args)
2075 context.__dict__.pop("_Context__conda_build", None)
2076 from ..models.channel import Channel
2077
2078 Channel._reset_state()
2079
2080 # need to import here to avoid circular dependency
2081
2082 # clear function cache
2083 from ..reporters import _get_render_func
2084
2085 # reload plugin config params
2086 with suppress(AttributeError):
2087 del context.plugins
2088
2089 _get_render_func.cache_clear()
2090
2091 return context
2092
2093
2094@contextmanager

Callers 15

exports.pyFile · 0.90
reset_conda_contextFunction · 0.90
temp_package_cacheFunction · 0.90
_solver_helperFunction · 0.90
__call__Method · 0.90
context_testdataFunction · 0.90
test_tmpDownloadFunction · 0.90

Calls 5

popMethod · 0.80
_reset_stateMethod · 0.80
cache_clearMethod · 0.45
__init__Method · 0.45

Tested by 15

test_tmpDownloadFunction · 0.72
test_confirm_yn_yesFunction · 0.72
test_confirm_yn_noFunction · 0.72
reset_environFunction · 0.72
test_PS1_no_changeps1Function · 0.72
test_posix_basicFunction · 0.72
test_cmd_exe_basicFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…