MCPcopy Create free account
hub / github.com/EndstoneMC/endstone / load_plugin

Method load_plugin

endstone/plugin/plugin_loader.py:115–142  ·  view source on GitHub ↗
(self, file: str)

Source from the content-addressed store, hash-verified

113 shutil.rmtree(os.path.join(site_dir, directory))
114
115 def load_plugin(self, file: str) -> Plugin | None:
116 env = os.environ.copy()
117 env.pop("LD_PRELOAD", "")
118
119 dist_name = pkginfo.Wheel(file).name
120 subprocess.run(
121 [
122 sys.executable,
123 "-m",
124 "pip",
125 "install",
126 file,
127 "--prefix",
128 self._prefix,
129 "--quiet",
130 "--no-warn-script-location",
131 "--disable-pip-version-check",
132 ],
133 env=env,
134 )
135
136 eps = distribution(dist_name).entry_points.select(group="endstone")
137 for ep in eps:
138 plugin = self._load_plugin_from_ep(ep)
139 if plugin:
140 return plugin
141
142 return None
143
144 def load_plugins(self, directory: str) -> list[Plugin]:
145 loaded_plugins = []

Callers 1

load_pluginsMethod · 0.95

Calls 4

_load_plugin_from_epMethod · 0.95
popMethod · 0.80
copyMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected