comfy-env 0.0.35__py3-none-any.whl → 0.0.37__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
comfy_env/install.py CHANGED
@@ -484,19 +484,31 @@ def _install_cuda_package(
484
484
  else:
485
485
  pkg_spec = f"{package}=={version}" if version else package
486
486
  log(f" Installing {package} (index)...")
487
- # Try to resolve exact wheel URL from index
488
- actual_version = resolved_version if "version_template" in config else version
489
- vars_dict = env.as_dict()
490
- wheel_url = resolve_wheel_from_index(index_url, package, vars_dict, actual_version)
491
- if wheel_url:
492
- # Install from resolved URL directly (guarantees we get what we resolved)
487
+
488
+ # Resolve version: use provided version, default_version, or None
489
+ effective_version = version if version and version != "*" else config.get("default_version")
490
+
491
+ # Check for wheel_template first (direct URL construction, no index parsing)
492
+ if "wheel_template" in config and effective_version:
493
+ vars_dict = env.as_dict()
494
+ vars_dict["version"] = effective_version
495
+ wheel_url = _substitute_template(config["wheel_template"], vars_dict)
493
496
  log(f" Wheel: {wheel_url}")
494
497
  _pip_install([wheel_url], no_deps=True, log=log)
495
498
  else:
496
- # Fallback to index-based resolution
497
- log(f" Index: {index_url}")
498
- log(f" Package: {pkg_spec}")
499
- _pip_install_with_index(pkg_spec, index_url, log)
499
+ # Try to resolve exact wheel URL from index
500
+ actual_version = resolved_version if "version_template" in config else version
501
+ vars_dict = env.as_dict()
502
+ wheel_url = resolve_wheel_from_index(index_url, package, vars_dict, actual_version)
503
+ if wheel_url:
504
+ # Install from resolved URL directly (guarantees we get what we resolved)
505
+ log(f" Wheel: {wheel_url}")
506
+ _pip_install([wheel_url], no_deps=True, log=log)
507
+ else:
508
+ raise InstallError(
509
+ f"Failed to resolve wheel URL for {package} from index {index_url}. "
510
+ "No matching wheel found and PyPI fallback is disabled.",
511
+ )
500
512
 
501
513
  elif method == "github_index":
502
514
  # GitHub Pages index - try to resolve exact wheel URL first
@@ -11,7 +11,7 @@ from pathlib import Path
11
11
  _comfyui_base = None
12
12
 
13
13
  def _find_comfyui_base():
14
- """Find ComfyUI base from COMFYUI_BASE env var or by walking up."""
14
+ """Find ComfyUI base from COMFYUI_BASE env var, child dirs, or by walking up."""
15
15
  global _comfyui_base
16
16
  if _comfyui_base:
17
17
  return _comfyui_base
@@ -21,8 +21,18 @@ def _find_comfyui_base():
21
21
  _comfyui_base = Path(os.environ["COMFYUI_BASE"])
22
22
  return _comfyui_base
23
23
 
24
+ # Check common child directories (for test environments)
25
+ # Also check parent's children (isolated venv is sibling to .comfy-test-env)
26
+ cwd = Path.cwd().resolve()
27
+ for base in [cwd, cwd.parent]:
28
+ for child in [".comfy-test-env/ComfyUI", "ComfyUI"]:
29
+ candidate = base / child
30
+ if (candidate / "main.py").exists() and (candidate / "comfy").exists():
31
+ _comfyui_base = candidate
32
+ return _comfyui_base
33
+
24
34
  # Walk up from cwd looking for ComfyUI
25
- current = Path.cwd().resolve()
35
+ current = cwd
26
36
  for _ in range(10):
27
37
  if (current / "main.py").exists() and (current / "comfy").exists():
28
38
  _comfyui_base = current
@@ -56,6 +56,7 @@ packages:
56
56
  method: index
57
57
  index_url: "https://miropsota.github.io/torch_packages_builder/pytorch3d/"
58
58
  wheel_template: "https://miropsota.github.io/torch_packages_builder/pytorch3d/pytorch3d-{version}%2Bpt{torch_version}cu{cuda_short}-{py_tag}-{py_tag}-{platform}.whl"
59
+ default_version: "0.7.9"
59
60
  description: PyTorch3D - 3D deep learning library
60
61
 
61
62
  # ===========================================================================
comfy_env/workers/venv.py CHANGED
@@ -594,7 +594,16 @@ class PersistentVenvWorker(Worker):
594
594
  self._worker_script.write_text(_PERSISTENT_WORKER_SCRIPT)
595
595
 
596
596
  def _find_comfyui_base(self) -> Optional[Path]:
597
- """Find ComfyUI base directory by walking up from working_dir."""
597
+ """Find ComfyUI base directory."""
598
+ # Check common child directories (for test environments)
599
+ # Also check parent's children (isolated venv is sibling to .comfy-test-env)
600
+ for base in [self.working_dir, self.working_dir.parent]:
601
+ for child in [".comfy-test-env/ComfyUI", "ComfyUI"]:
602
+ candidate = base / child
603
+ if (candidate / "main.py").exists() and (candidate / "comfy").exists():
604
+ return candidate
605
+
606
+ # Walk up from working_dir (standard ComfyUI custom_nodes layout)
598
607
  current = self.working_dir.resolve()
599
608
  for _ in range(10):
600
609
  if (current / "main.py").exists() and (current / "comfy").exists():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.0.35
3
+ Version: 0.0.37
4
4
  Summary: Environment management for ComfyUI custom nodes - CUDA wheel resolution and process isolation
5
5
  Project-URL: Homepage, https://github.com/PozzettiAndrea/comfy-env
6
6
  Project-URL: Repository, https://github.com/PozzettiAndrea/comfy-env
@@ -3,7 +3,7 @@ comfy_env/cli.py,sha256=X-GCQMP0mtMcE3ZgkT-VLQ4Gq3UUvcb_Ux_NClEFhgI,15975
3
3
  comfy_env/decorator.py,sha256=6JCKwLHaZtOLVDexs_gh_-NtS2ZK0V7nGCPqkyeYEAA,16688
4
4
  comfy_env/errors.py,sha256=8hN8NDlo8oBUdapc-eT3ZluigI5VBzfqsSBvQdfWlz4,9943
5
5
  comfy_env/index_resolver.py,sha256=D8BttTJ7BOiukUvmdT6_dGdzFV3CahGL2m28X-HwPeE,4650
6
- comfy_env/install.py,sha256=eS3Q8T9bFP4AH2PfqLmjqWA8cu8vJsg02aXBTP5x1IQ,30446
6
+ comfy_env/install.py,sha256=SeYcnvFErBpAvTMG1L02PMKt39yrD_9WHGiFfaJ_igA,31172
7
7
  comfy_env/nodes.py,sha256=CWUe35jU5SKk4ur-SddZePdqWgxJDlxGhpcJiu5pAK4,4354
8
8
  comfy_env/pixi.py,sha256=y25mUDhB3bCqhPMGF0h23Tf8ZHykK4gLJrkvOhsPWmE,14398
9
9
  comfy_env/registry.py,sha256=uFCtGmWYvwGCqObXgzmArX7o5JsFNsHXxayofk3m6no,2569
@@ -27,16 +27,16 @@ comfy_env/ipc/torch_bridge.py,sha256=WzdwDJa3N_1fEl9OeZxikvMbwryO5P63o0WmEDpS18A
27
27
  comfy_env/ipc/transport.py,sha256=XQlRcfQsd4nd909KIYnZKvsS3ksGpGjyVucn8jvmLIU,9698
28
28
  comfy_env/ipc/worker.py,sha256=oxTLF9xXrl8CRx_JVNBdkxZh35NuzfkdxhaUtUuXogs,6661
29
29
  comfy_env/stubs/__init__.py,sha256=jMeWEKY30y8QqYX9AUyuZbmm607erQTc4N7YaDoAH00,38
30
- comfy_env/stubs/folder_paths.py,sha256=Pv30qHeHBmfK5icIpmXnTGvZkRMJHDrTh9mQ1WMclLg,1713
30
+ comfy_env/stubs/folder_paths.py,sha256=K90J34EG6LD4eZP8YG-xMeBmqwpp_wA8E92DKMXd1GQ,2189
31
31
  comfy_env/workers/__init__.py,sha256=IKZwOvrWOGqBLDUIFAalg4CdqzJ_YnAdxo2Ha7gZTJ0,1467
32
32
  comfy_env/workers/base.py,sha256=ZILYXlvGCWuCZXmjKqfG8VeD19ihdYaASdlbasl2BMo,2312
33
33
  comfy_env/workers/pool.py,sha256=MtjeOWfvHSCockq8j1gfnxIl-t01GSB79T5N4YB82Lg,6956
34
34
  comfy_env/workers/tensor_utils.py,sha256=TCuOAjJymrSbkgfyvcKtQ_KbVWTqSwP9VH_bCaFLLq8,6409
35
35
  comfy_env/workers/torch_mp.py,sha256=4YSNPn7hALrvMVbkO4RkTeFTcc0lhfLMk5QTWjY4PHw,22134
36
- comfy_env/workers/venv.py,sha256=_ekHfZPqBIPY08DjqiXm6cTBQH4DrbxRWR3AAv3mit8,31589
37
- comfy_env/wheel_sources.yml,sha256=bPUOez9puILIh28FBWSacgiK9bx03aUwwZqLaWE6PqA,8978
38
- comfy_env-0.0.35.dist-info/METADATA,sha256=jFl8nMSZjewzGmHEIu0XlH-m1g75oy2igVP9adUpX3c,5400
39
- comfy_env-0.0.35.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
40
- comfy_env-0.0.35.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
41
- comfy_env-0.0.35.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
42
- comfy_env-0.0.35.dist-info/RECORD,,
36
+ comfy_env/workers/venv.py,sha256=PmsVOu5i89tBYkGRupo2bjOLPBmk06q4GNUwDWsd9F8,32088
37
+ comfy_env/wheel_sources.yml,sha256=WHSSgbEXDKgRdJAi5FKiEU0l5dFxP_1p4JThc1bbqj8,9007
38
+ comfy_env-0.0.37.dist-info/METADATA,sha256=R3q3cGBk8UxTqwtBBp4RqyozCkO_k8_0wy0qhNMhI9A,5400
39
+ comfy_env-0.0.37.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
40
+ comfy_env-0.0.37.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
41
+ comfy_env-0.0.37.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
42
+ comfy_env-0.0.37.dist-info/RECORD,,