(self, file: str)
| 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 = [] |
no test coverage detected