Skip to content

Commit

Permalink
set sd-scripts release via file
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 2, 2024
1 parent 5c930f1 commit d7737c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .sd-scripts-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.8.4
15 changes: 15 additions & 0 deletions setup/setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
errors = 0 # Define the 'errors' variable before using it
log = logging.getLogger('sd')

def read_tag_version_from_file(file_path):
"""
Read the tag version from a given file.
Parameters:
- file_path: The path to the file containing the tag version.
Returns:
The tag version as a string.
"""
with open(file_path, 'r') as file:
# Read the first line and strip whitespace
tag_version = file.readline().strip()
return tag_version

def clone_or_checkout(repo_url, branch_or_tag, directory_name):
"""
Clone a repo or checkout a specific branch or tag if the repo already exists.
Expand Down
7 changes: 6 additions & 1 deletion setup/setup_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ def sync_bits_and_bytes_files():
def install_kohya_ss_torch2():
setup_common.check_repo_version()
setup_common.check_python()

# Read the tag version from the file
tag_version = setup_common.read_tag_version_from_file(".\.sd-scripts-release")

setup_common.clone_or_checkout("https://github.com/kohya-ss/sd-scripts.git", "v0.8.4", "sd-scripts")
setup_common.clone_or_checkout(
"https://github.com/kohya-ss/sd-scripts.git", tag_version, "sd-scripts"
)

# Upgrade pip if needed
setup_common.install("--upgrade pip")
Expand Down

0 comments on commit d7737c8

Please sign in to comment.