comfy-env 0.0.72__py3-none-any.whl → 0.0.73__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
@@ -55,7 +55,11 @@ def install(
55
55
  "Create comfy-env.toml to define dependencies."
56
56
  )
57
57
 
58
- # Install node dependencies first
58
+ # Install apt packages first (Linux only)
59
+ if cfg.apt_packages:
60
+ _install_apt_packages(cfg.apt_packages, log, dry_run)
61
+
62
+ # Install node dependencies
59
63
  if cfg.node_reqs:
60
64
  _install_node_dependencies(cfg.node_reqs, node_dir, log, dry_run)
61
65
 
@@ -69,6 +73,66 @@ def install(
69
73
  return True
70
74
 
71
75
 
76
+ def _install_apt_packages(
77
+ packages: List[str],
78
+ log: Callable[[str], None],
79
+ dry_run: bool,
80
+ ) -> None:
81
+ """Install apt packages (Linux only)."""
82
+ import os
83
+ import platform
84
+ import shutil
85
+ import subprocess
86
+
87
+ if platform.system() != "Linux":
88
+ log(f"[apt] Skipping apt packages (not Linux)")
89
+ return
90
+
91
+ log(f"\n[apt] Installing {len(packages)} system package(s):")
92
+ for pkg in packages:
93
+ log(f" - {pkg}")
94
+
95
+ if dry_run:
96
+ log(" (dry run - no changes made)")
97
+ return
98
+
99
+ # Determine if we need sudo
100
+ is_root = os.geteuid() == 0
101
+ has_sudo = shutil.which("sudo") is not None
102
+ use_sudo = not is_root and has_sudo
103
+ prefix = ["sudo"] if use_sudo else []
104
+
105
+ if not is_root and not has_sudo:
106
+ log(f"[apt] Warning: No root access. Install manually:")
107
+ log(f" sudo apt-get update && sudo apt-get install -y {' '.join(packages)}")
108
+ return
109
+
110
+ # Run apt-get update (suppress output, just show errors)
111
+ log("[apt] Updating package lists...")
112
+ result = subprocess.run(
113
+ prefix + ["apt-get", "update"],
114
+ capture_output=True,
115
+ text=True,
116
+ )
117
+ if result.returncode != 0:
118
+ log(f"[apt] Warning: apt-get update failed: {result.stderr.strip()}")
119
+
120
+ # Run apt-get install
121
+ log(f"[apt] Installing packages...")
122
+ result = subprocess.run(
123
+ prefix + ["apt-get", "install", "-y"] + packages,
124
+ capture_output=True,
125
+ text=True,
126
+ )
127
+
128
+ if result.returncode == 0:
129
+ log("[apt] System packages installed successfully!")
130
+ else:
131
+ log(f"[apt] Warning: Installation failed: {result.stderr.strip()}")
132
+ log(f"[apt] You may need to install manually:")
133
+ log(f" sudo apt-get install -y {' '.join(packages)}")
134
+
135
+
72
136
  def _install_node_dependencies(
73
137
  node_reqs: List[NodeReq],
74
138
  node_dir: Path,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.0.72
3
+ Version: 0.0.73
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
@@ -1,7 +1,7 @@
1
1
  comfy_env/__init__.py,sha256=s0RkyKsBlDiSI4ZSwivtWLvYhc8DS0CUEWgFLVJbtLA,2176
2
2
  comfy_env/cli.py,sha256=ty4HYlzollCUCS0o6Sha6eczPAsW_gHRVgvck3IfA2w,12723
3
3
  comfy_env/errors.py,sha256=q-C3vyrPa_kk_Ao8l17mIGfJiG2IR0hCFV0GFcNLmcI,9924
4
- comfy_env/install.py,sha256=Fkjk3ci9_mAabUFqyuXShV9-Ry2iTX-JWAx9fnr5q_Q,5098
4
+ comfy_env/install.py,sha256=t7C5lpF3NVDlAKiRR0TsgYlK6icn7NEtKOU3uGbHnZc,7072
5
5
  comfy_env/nodes.py,sha256=nBkG2pESeOt5kXSgTDIHAHaVdHK8-rEueR3BxXWn6TE,4354
6
6
  comfy_env/prestartup.py,sha256=rP0TtT9lxiU7Py27U79Ew7954VpHsYL6lfx4IpQY1Uc,3152
7
7
  comfy_env/config/__init__.py,sha256=4Guylkb-FV8QxhFwschzpzbr2eu8y-KNgNT3_JOm9jc,403
@@ -25,8 +25,8 @@ comfy_env/workers/base.py,sha256=4ZYTaQ4J0kBHCoO_OfZnsowm4rJCoqinZUaOtgkOPbw,230
25
25
  comfy_env/workers/mp.py,sha256=d6PFVrgqp3MK7Gkt08a8LQD_VSwHtoIcGx2Lovou3vM,25972
26
26
  comfy_env/workers/subprocess.py,sha256=UMhKhaJoSjv2-FWnwQq9TeMWtaDLIs3ajAFTq1ngdJw,57844
27
27
  comfy_env/workers/tensor_utils.py,sha256=TCuOAjJymrSbkgfyvcKtQ_KbVWTqSwP9VH_bCaFLLq8,6409
28
- comfy_env-0.0.72.dist-info/METADATA,sha256=Z0aiB9t0vBMRBP71_5wt6AeOd13lW1gkX8IE0Mg-kg0,6946
29
- comfy_env-0.0.72.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
30
- comfy_env-0.0.72.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
31
- comfy_env-0.0.72.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
32
- comfy_env-0.0.72.dist-info/RECORD,,
28
+ comfy_env-0.0.73.dist-info/METADATA,sha256=-VodLMkozSi5lHL_8xyarwc3SCWGSdIsfNPdSzCjZ4U,6946
29
+ comfy_env-0.0.73.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
30
+ comfy_env-0.0.73.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
31
+ comfy_env-0.0.73.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
32
+ comfy_env-0.0.73.dist-info/RECORD,,