(
search_path: PathsType = SEARCH_PATH,
argparse_args: Namespace | None = None,
)
| 2060 | |
| 2061 | |
| 2062 | def 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 |
searching dependent graphs…