Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c069c13c5 |
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Report the `desktop-linux` form factor to the registry for Desktop installs
|
||||||
|
on Linux, which previously reported `other`.
|
||||||
|
|
||||||
## [4.3] - 2026-09-19
|
## [4.3] - 2026-09-19
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|||||||
@@ -20,6 +20,29 @@ lock = asyncio.Lock()
|
|||||||
|
|
||||||
is_cache_loading = False
|
is_cache_loading = False
|
||||||
|
|
||||||
|
def get_form_factor():
|
||||||
|
"""Form factor reported to the registry, based on environment and platform."""
|
||||||
|
is_desktop = bool(os.environ.get('__COMFYUI_DESKTOP_VERSION__'))
|
||||||
|
system = platform.system().lower()
|
||||||
|
|
||||||
|
if is_desktop:
|
||||||
|
if system == 'windows':
|
||||||
|
return 'desktop-win'
|
||||||
|
if system == 'darwin':
|
||||||
|
return 'desktop-mac'
|
||||||
|
if system == 'linux':
|
||||||
|
return 'desktop-linux'
|
||||||
|
return 'other'
|
||||||
|
|
||||||
|
if system == 'windows':
|
||||||
|
return 'git-windows'
|
||||||
|
if system == 'darwin':
|
||||||
|
return 'git-mac'
|
||||||
|
if system == 'linux':
|
||||||
|
return 'git-linux'
|
||||||
|
return 'other'
|
||||||
|
|
||||||
|
|
||||||
async def get_cnr_data(cache_mode=True, dont_wait=True):
|
async def get_cnr_data(cache_mode=True, dont_wait=True):
|
||||||
try:
|
try:
|
||||||
return await _get_cnr_data(cache_mode, dont_wait)
|
return await _get_cnr_data(cache_mode, dont_wait)
|
||||||
@@ -39,12 +62,7 @@ async def _get_cnr_data(cache_mode=True, dont_wait=True):
|
|||||||
full_nodes = {}
|
full_nodes = {}
|
||||||
|
|
||||||
|
|
||||||
# Determine form factor based on environment and platform
|
|
||||||
is_desktop = bool(os.environ.get('__COMFYUI_DESKTOP_VERSION__'))
|
is_desktop = bool(os.environ.get('__COMFYUI_DESKTOP_VERSION__'))
|
||||||
system = platform.system().lower()
|
|
||||||
is_windows = system == 'windows'
|
|
||||||
is_mac = system == 'darwin'
|
|
||||||
is_linux = system == 'linux'
|
|
||||||
|
|
||||||
# Get ComfyUI version tag
|
# Get ComfyUI version tag
|
||||||
if is_desktop:
|
if is_desktop:
|
||||||
@@ -53,22 +71,7 @@ async def _get_cnr_data(cache_mode=True, dont_wait=True):
|
|||||||
else:
|
else:
|
||||||
comfyui_ver = context.get_comfyui_tag() or 'unknown'
|
comfyui_ver = context.get_comfyui_tag() or 'unknown'
|
||||||
|
|
||||||
if is_desktop:
|
form_factor = get_form_factor()
|
||||||
if is_windows:
|
|
||||||
form_factor = 'desktop-win'
|
|
||||||
elif is_mac:
|
|
||||||
form_factor = 'desktop-mac'
|
|
||||||
else:
|
|
||||||
form_factor = 'other'
|
|
||||||
else:
|
|
||||||
if is_windows:
|
|
||||||
form_factor = 'git-windows'
|
|
||||||
elif is_mac:
|
|
||||||
form_factor = 'git-mac'
|
|
||||||
elif is_linux:
|
|
||||||
form_factor = 'git-linux'
|
|
||||||
else:
|
|
||||||
form_factor = 'other'
|
|
||||||
|
|
||||||
from comfyui_manager.glob import manager_core
|
from comfyui_manager.glob import manager_core
|
||||||
verbose = manager_core.get_config().get('verbose', False)
|
verbose = manager_core.get_config().get('verbose', False)
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
"""Form factor the CNR client reports to the registry."""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from _install_flags_testutil import import_context
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def cnr_utils():
|
||||||
|
import_context()
|
||||||
|
from comfyui_manager.common import cnr_utils
|
||||||
|
|
||||||
|
return cnr_utils
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
('system', 'desktop', 'expected'),
|
||||||
|
[
|
||||||
|
('Windows', True, 'desktop-win'),
|
||||||
|
('Darwin', True, 'desktop-mac'),
|
||||||
|
('Linux', True, 'desktop-linux'),
|
||||||
|
('FreeBSD', True, 'other'),
|
||||||
|
('Windows', False, 'git-windows'),
|
||||||
|
('Darwin', False, 'git-mac'),
|
||||||
|
('Linux', False, 'git-linux'),
|
||||||
|
('FreeBSD', False, 'other'),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_form_factor(cnr_utils, monkeypatch, system, desktop, expected):
|
||||||
|
monkeypatch.setattr(cnr_utils.platform, 'system', lambda: system)
|
||||||
|
if desktop:
|
||||||
|
monkeypatch.setenv('__COMFYUI_DESKTOP_VERSION__', '1.0.0')
|
||||||
|
else:
|
||||||
|
monkeypatch.delenv('__COMFYUI_DESKTOP_VERSION__', raising=False)
|
||||||
|
|
||||||
|
assert cnr_utils.get_form_factor() == expected
|
||||||
Reference in New Issue
Block a user