Enhance Settings.fds management and installation checks

- Introduced functions to ensure the `IsInstalled` flag is set in `Settings.fds`, preventing the UI from displaying the /Install wizard.
- Added logic to create or patch `Settings.fds` with installation details, including the installation date and version.
- Updated the `install_swarm_comfy.py` script to call the new function, ensuring the installation state is correctly managed during backend operations.
- Added tests to verify the presence of the `IsInstalled` flag in the relevant scripts and ensure proper functionality during installation checks.
This commit is contained in:
Leonid Pershin
2026-08-21 11:27:06 +03:00
parent 241ada62cb
commit fc60fef279
3 changed files with 204 additions and 2 deletions
+19
View File
@@ -94,3 +94,22 @@ def test_cli_has_update_flag():
src = Path(cli.__file__).read_text(encoding="utf-8")
assert '"--update"' in src
assert "force_update" in src
def test_autocomplete_merge_sets_is_installed():
from gpu_rent import provision
from gpu_rent.provision import _AUTOCOMPLETE_MERGE_PY, _ENSURE_INSTALLED_PY
assert "IsInstalled: true" in _AUTOCOMPLETE_MERGE_PY
assert "IsInstalled: true" in _ENSURE_INSTALLED_PY
assert hasattr(provision, "ensure_settings_is_installed")
def test_install_comfy_patches_is_installed_on_skip():
from importlib.resources import files
text = files("gpu_rent.remote").joinpath("install_swarm_comfy.py").read_text(
encoding="utf-8"
)
assert "ensure_settings_installed_flag" in text
assert "leave /Install" in text