chore: Bump version to 0.12.6, update BlendJob wheel to 0.1.8, and revise documentation for model catalog and server integration
Some checks failed
构建扩展 / build (push) Failing after 14s

This commit is contained in:
2026-08-17 21:36:58 +08:00
parent fb78a8068b
commit 6e6dd60a88
12 changed files with 242 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
import importlib
import importlib.util
import sys
import tempfile
import threading
@@ -13,12 +13,15 @@ PROJECT_ROOT = Path(__file__).resolve().parents[1]
def load_server_module():
addon_directory = PROJECT_ROOT / "src" / "snapform"
sys.path.insert(0, str(addon_directory))
try:
return importlib.import_module("server")
finally:
sys.path.remove(str(addon_directory))
server_directory = PROJECT_ROOT / "src" / "snapform" / "server"
specification = importlib.util.spec_from_file_location(
"server", server_directory / "__init__.py",
submodule_search_locations=[str(server_directory)],
)
module = importlib.util.module_from_spec(specification)
sys.modules["server"] = module
specification.loader.exec_module(module)
return module
class FakeCuda:
@@ -70,8 +73,12 @@ class ServerTest(unittest.TestCase):
with tempfile.TemporaryDirectory() as directory:
manager = self.server_module.ModelManager(Path(directory))
snapshot = manager.snapshot()
self.assertIn("catalog", snapshot)
self.assertTrue(snapshot["catalog"])
self.assertEqual(
snapshot,
{"loaded": {"ben2": "", "da3": "", "moge2": ""}},
)
self.assertIn("server.model_catalog", sys.modules)
self.assertNotIn("model_catalog", sys.modules)
def create_cache(self):
cache = self.server_module.ModelSessionCache.__new__(