ci: create a nightly build workflow (#3553)
* test poetry install * Add nightly builds workflow * remove old comments and fix poetry * remove old debug statement * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
414bfe799e
commit
7b3e51f769
22 changed files with 1770 additions and 1055 deletions
|
|
@ -31,9 +31,22 @@ def get_version_from_pypi(package_name):
|
|||
return None
|
||||
|
||||
|
||||
def update_pyproject_dependency(pyproject_path, version):
|
||||
def is_development_release(version):
|
||||
"""
|
||||
Determines if the version is a development version based on PEP 440.
|
||||
|
||||
We consider a development version (.devN) as our nightly versions
|
||||
"""
|
||||
return "dev" in version
|
||||
|
||||
|
||||
def update_pyproject_dependency(pyproject_path, version, is_nightly):
|
||||
pattern = re.compile(r'langflow-base = \{ path = "\./src/backend/base", develop = true \}')
|
||||
replacement = f'langflow-base = "^{version}"'
|
||||
if is_nightly:
|
||||
# NOTE: This process can be simplified; see the note in update_lf_base_dependency.py
|
||||
replacement = f'langflow-base-nightly = "{version}"'
|
||||
else:
|
||||
replacement = f'langflow-base = "^{version}"'
|
||||
with open(pyproject_path, "r") as file:
|
||||
content = file.read()
|
||||
content = pattern.sub(replacement, content)
|
||||
|
|
@ -57,6 +70,9 @@ if __name__ == "__main__":
|
|||
langflow_base_path = Path(__file__).resolve().parent / "../src/backend/base/pyproject.toml"
|
||||
version = read_version_from_pyproject(langflow_base_path)
|
||||
if version:
|
||||
update_pyproject_dependency(pyproject_path, version)
|
||||
# Nightly versions contain "dev"
|
||||
# WARNING: This will cause issues if we release `.dev` versions to `langflow` or `langflow-base`
|
||||
is_nightly = is_development_release(version)
|
||||
update_pyproject_dependency(pyproject_path, version, is_nightly)
|
||||
else:
|
||||
print("Error: Version not found.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue