Skip to content

Commit

Permalink
fix DependencyCompiler unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Aug 27, 2024
1 parent 5b783c5 commit 0348aa4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion tests/uv/mock_requirements/requirements.compiled
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# This file was autogenerated by uv via the following command:
# uv pip compile /home/tel/git/comfy-cli/tests/uv/mock_requirements/core_reqs.txt /home/tel/git/comfy-cli/tests/uv/mock_requirements/x_reqs.txt /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt --index-strategy unsafe-best-match --override /home/tel/git/comfy-cli/tests/temp/test_uv/override.txt -o /home/tel/git/comfy-cli/tests/temp/test_uv/requirements.compiled
# uv pip compile /home/tel/git/comfy-cli/tests/uv/mock_requirements/core_reqs.txt /home/tel/git/comfy-cli/tests/uv/mock_requirements/x_reqs.txt /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt --emit-index-annotation --emit-index-url --index-strategy unsafe-best-match -o /home/tel/git/comfy-cli/tests/temp/test_uv/requirements.compiled --override /home/tel/git/comfy-cli/tests/temp/test_uv/override.txt
--index-url https://pypi.org/simple
--extra-index-url https://download.pytorch.org/whl/rocm6.1

mpmath==1.3.0
# via
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt
# sympy
# from https://download.pytorch.org/whl/rocm6.1
numpy==2.0.0
# via
# --override override.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/x_reqs.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt
# from https://pypi.org/simple
sympy==1.13.0
# via
# --override override.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/x_reqs.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt
# from https://pypi.org/simple
tqdm==4.66.4
# via
# --override override.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/core_reqs.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/x_reqs.txt
# -r /home/tel/git/comfy-cli/tests/uv/mock_requirements/y_reqs.txt
# from https://pypi.org/simple
6 changes: 4 additions & 2 deletions tests/uv/test_uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest

from comfy_cli import ui
from comfy_cli.constants import GPU_OPTION
from comfy_cli.uv import DependencyCompiler

hereDir = Path(__file__).parent.resolve()
Expand All @@ -29,6 +30,7 @@ def _mock_prompt_select(*args, **kwargs):
def test_compile(mock_prompt_select):
depComp = DependencyCompiler(
cwd=temp,
gpu=GPU_OPTION.AMD,
outDir=temp,
reqFilesCore=[reqsDir / "core_reqs.txt"],
reqFilesExt=[reqsDir / "x_reqs.txt", reqsDir / "y_reqs.txt"],
Expand All @@ -40,7 +42,7 @@ def test_compile(mock_prompt_select):
with open(reqsDir / "requirements.compiled", "r") as known, open(temp / "requirements.compiled", "r") as test:
# compare all non-commented lines in generated file vs reference file
knownLines, testLines = [
[line for line in known.readlines() if line.strip()[0] != "#"],
[line for line in test.readlines() if line.strip()[0] != "#"],
[line for line in known.readlines() if not line.strip().startswith("#")],
[line for line in test.readlines() if not line.strip().startswith("#")],
]
assert knownLines == testLines

0 comments on commit 0348aa4

Please sign in to comment.