mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
Compare commits
2 Commits
main
...
update-sub
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2eab67bbe4 | ||
|
|
840aa567ea |
@@ -100,18 +100,6 @@ class MInstaller:
|
||||
|
||||
return "dependency", []
|
||||
|
||||
async def pip(self, dependencies: List[str]) -> bool:
|
||||
virtualenv = hasattr(sys, 'real_prefix') or sys.prefix != getattr(sys, 'base_prefix', sys.prefix)
|
||||
flags = ["--user"] if loader.USER_INSTALL and not virtualenv else []
|
||||
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
sys.executable, "-m", "pip", "install", "-U", "-q",
|
||||
"--disable-pip-version-check", "--no-warn-script-location",
|
||||
*flags, *dependencies
|
||||
)
|
||||
|
||||
return await process.wait() == 0
|
||||
|
||||
async def load(self, plugin: 'loader.Module', code: str, origin: str, step: int) -> Union[str, List[str]]:
|
||||
if step == 0:
|
||||
try:
|
||||
@@ -121,7 +109,7 @@ class MInstaller:
|
||||
))
|
||||
|
||||
if dependencies:
|
||||
if not await self.pip(dependencies):
|
||||
if not await plugin.install_requirements(dependencies):
|
||||
return dependencies
|
||||
importlib.invalidate_caches()
|
||||
return "retry"
|
||||
@@ -171,7 +159,7 @@ class MInstaller:
|
||||
alternative = {"sklearn": "scikit-learn", "pil": "Pillow", "herokutl": "Heroku-TL-New"}.get(exception.name.lower(), exception.name)
|
||||
dependencies = [alternative]
|
||||
|
||||
if not alternative or not await self.pip(dependencies):
|
||||
if not alternative or not await plugin.install_requirements(dependencies):
|
||||
return dependencies
|
||||
|
||||
importlib.invalidate_caches()
|
||||
|
||||
@@ -84952,6 +84952,6 @@
|
||||
},
|
||||
"meta": {
|
||||
"total_modules": 1057,
|
||||
"generated_at": "2026-04-12T17:39:10.030299"
|
||||
"generated_at": "2026-04-13T02:02:20.410901"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user