Skip to content

Commit

Permalink
Use constant for downloading python standalone version. (#177)
Browse files Browse the repository at this point in the history
* Create constant for downloading python standalone version.

* Ruff fix.
  • Loading branch information
robinjhuang authored Sep 13, 2024
1 parent b6ac43a commit 0cb961e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions comfy_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ class GPU_OPTION(str, Enum):
SUPPORTED_PT_EXTENSIONS = (".ckpt", ".pt", ".bin", ".pth", ".safetensors")

NODE_ZIP_FILENAME = "node.zip"

# The default version to download from python-build-standalone.
DEFAULT_STANDALONE_PYTHON_DOWNLOAD_VERSION = "3.12.6"
6 changes: 3 additions & 3 deletions comfy_cli/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import requests

from comfy_cli.constants import OS, PROC
from comfy_cli.constants import DEFAULT_STANDALONE_PYTHON_DOWNLOAD_VERSION, OS, PROC
from comfy_cli.typing import PathLike
from comfy_cli.utils import create_tarball, download_url, extract_tarball, get_os, get_proc
from comfy_cli.uv import DependencyCompiler
Expand All @@ -28,7 +28,7 @@
def download_standalone_python(
platform: Optional[str] = None,
proc: Optional[str] = None,
version: str = "3.12.5",
version: str = DEFAULT_STANDALONE_PYTHON_DOWNLOAD_VERSION,
tag: str = "latest",
flavor: str = "install_only",
cwd: PathLike = ".",
Expand Down Expand Up @@ -65,7 +65,7 @@ class StandalonePython:
def FromDistro(
platform: Optional[str] = None,
proc: Optional[str] = None,
version: str = "3.12.6",
version: str = DEFAULT_STANDALONE_PYTHON_DOWNLOAD_VERSION,
tag: str = "latest",
flavor: str = "install_only",
cwd: PathLike = ".",
Expand Down

0 comments on commit 0cb961e

Please sign in to comment.