mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 04:28:58 +00:00
anthropic[patch]: Release 0.1.17 (#23650)
This commit is contained in:
42
scripts/release_branch.py
Normal file
42
scripts/release_branch.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
python scripts/release_branch.py anthropic bagatur
|
||||
"""
|
||||
import glob
|
||||
import tomllib
|
||||
import toml
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def main(*args):
|
||||
pkg = args[1]
|
||||
if len(args) >= 2:
|
||||
user = args[2]
|
||||
else:
|
||||
user = "auto"
|
||||
for path in glob.glob("./libs/**/pyproject.toml", recursive=True):
|
||||
if pkg in path:
|
||||
break
|
||||
|
||||
with open(path, "rb") as f:
|
||||
pyproject = tomllib.load(f)
|
||||
major, minor, patch = pyproject["tool"]["poetry"]["version"].split(".")
|
||||
patch = str(int(patch) + 1)
|
||||
bumped = ".".join((major, minor, patch))
|
||||
pyproject["tool"]["poetry"]["version"] = bumped
|
||||
with open(path, "w") as f:
|
||||
toml.dump(pyproject, f)
|
||||
|
||||
branch = f"{user}/{pkg}_{bumped.replace('.', '_')}"
|
||||
print(
|
||||
subprocess.run(
|
||||
f"git checkout -b {branch}; git commit -am '{pkg}[patch]: Release {bumped}'; git push -u origin {branch}",
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(*sys.argv)
|
Reference in New Issue
Block a user