Skip to content

refactor: extract torch install helper and unify PR reference parsers#389

Merged
bigcat88 merged 1 commit intomainfrom
refactor/dedup-torch-install-and-pr-parsers
Mar 27, 2026
Merged

refactor: extract torch install helper and unify PR reference parsers#389
bigcat88 merged 1 commit intomainfrom
refactor/dedup-torch-install-and-pr-parsers

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

The torch installation in pip_install_comfyui_dependencies repeated the same subprocess.run([python, "-m", "pip", "install", "torch", "torchvision", "torchaudio"] + index_args) pattern four times for AMD Linux, NVIDIA, Intel Arc, and CPU backends. Extracted a _pip_install_torch helper that all four call. DirectML and Mac M Series have different command shapes so they stay inline.

parse_pr_reference and parse_frontend_pr_reference were copy-pasted functions that only differed in the default repo (comfyanonymous/ComfyUI vs Comfy-Org/ComfyUI_frontend). Unified them into a shared _parse_pr_reference(pr_ref, default_owner, default_repo) with thin public wrappers. Also hardcoded the upstream repo in handle_temporary_frontend_pr's find_pr_by_branch call to match how handle_pr_checkout already works.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 27, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
comfy_cli/command/install.py 75.00% 4 Missing ⚠️
@@            Coverage Diff             @@
##             main     #389      +/-   ##
==========================================
- Coverage   71.07%   70.98%   -0.10%     
==========================================
  Files          33       33              
  Lines        3931     3915      -16     
==========================================
- Hits         2794     2779      -15     
+ Misses       1137     1136       -1     
Files with missing lines Coverage Δ
comfy_cli/command/install.py 75.59% <75.00%> (-0.56%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88 bigcat88 merged commit e9f60d5 into main Mar 27, 2026
14 checks passed
@bigcat88 bigcat88 deleted the refactor/dedup-torch-install-and-pr-parsers branch March 27, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant