Skip to content

Commit

Permalink
relative dir
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Oct 25, 2024
1 parent 95e4860 commit 4cbdae7
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions scripts/ci/update_pyproject_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
# scripts/ci/update_pyproject_combined.py

import sys
from scripts.ci.update_pyproject_version import main as update_version
from scripts.ci.update_pyproject_name import main as update_name
from scripts.ci.update_uv_dependency import main as update_dependency
import os

# Add the current directory to the path so we can import the other scripts
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(current_dir)

from update_pyproject_version import main as update_version
from update_pyproject_name import main as update_name
from update_uv_dependency import main as update_dependency

def main():
"""
Universal update script that handles both base and main scenarios.
Usage:
Base scenario: update_pyproject_combined.py base <base_tag>
Main scenario: update_pyproject_combined.py main <main_tag> <base_tag>
Expand All @@ -20,31 +25,30 @@ def main():
print(" Base: update_pyproject_combined.py base <base_tag>")
print(" Main: update_pyproject_combined.py main <main_tag> <base_tag>")
sys.exit(1)

mode = sys.argv[1]

if mode == "base":
if len(sys.argv) != 3:
print("Base mode requires: <base_tag>")
sys.exit(1)
base_tag = sys.argv[2]
update_name("langflow-base-nightly", "base")
update_version(base_tag, "base")

update_name('langflow-base-nightly', 'base')
update_version(base_tag, 'base')
elif mode == "main":
if len(sys.argv) != 4:
print("Main mode requires: <main_tag> <base_tag>")
sys.exit(1)
main_tag = sys.argv[2]
base_tag = sys.argv[3]
update_version(main_tag, "main")
update_name("langflow-nightly", "main")
update_version(main_tag, 'main')
update_name('langflow-nightly', 'main')
update_dependency(base_tag)

else:
print(f"Unknown mode: {mode}")
sys.exit(1)


if __name__ == "__main__":
main()

0 comments on commit 4cbdae7

Please sign in to comment.