From 7a002eda6298081a8d5784e9cdcad0aac4ffc99f Mon Sep 17 00:00:00 2001 From: Marie PUPO JEAMMET Date: Mon, 20 Apr 2026 16:14:42 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(scripts)=20update=20release=20script?= =?UTF-8?q?=20to=20include=20uv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update release script to automatically upgrade people's version on uv.lock file --- CHANGELOG.md | 1 + scripts/release.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcde7d24..124bbf4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to ### Added +- ✨(scripts) update release script to include uv - ✨(dimail) auto-import mailboxes from enabled domains ### Fixed diff --git a/scripts/release.py b/scripts/release.py index 6b951401..945c7c26 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -14,7 +14,7 @@ RELEASE_KINDS = {'p': 'patch', 'm': 'minor', 'mj': 'major'} def update_files(version): """Update all files needed with new release version""" # pyproject.toml - sys.stdout.write("Update pyproject.toml...\n") + sys.stdout.write("Updating pyproject.toml...\n") path = "src/backend/pyproject.toml" with open(path, 'r') as file: lines = file.readlines() @@ -24,8 +24,12 @@ def update_files(version): with open(path, 'w+') as file: file.writelines(lines) + # uv lock file + sys.stdout.write("Updating uv lock file...\n") + run_command("uv lock --directory src/backend", shell=True) + # frontend package.json - sys.stdout.write("Update package.json...\n") + sys.stdout.write("Updating package.json...\n") files_to_modify = [] filename = "package.json" for root, _dir, files in os.walk("src/frontend"): @@ -40,11 +44,12 @@ def update_files(version): lines[index] = re.sub(r'"version": \"(.*?)\"', f'"version": "{version}"', line) with open(path, 'w+') as file: file.writelines(lines) + return def update_helm_files(path): - sys.stdout.write("Update helm files...\n") + sys.stdout.write("Updating helm files...\n") with open(path, 'r') as file: lines = file.readlines() for index, line in enumerate(lines): @@ -57,7 +62,7 @@ def update_helm_files(path): def update_changelog(path, version): """Update changelog file with release info """ - sys.stdout.write("Update CHANGELOG...\n") + sys.stdout.write("Updating CHANGELOG...\n") with open(path, 'r') as file: lines = file.readlines() for index, line in enumerate(lines): @@ -73,9 +78,9 @@ def update_changelog(path, version): break with open(path, 'w+') as file: - file.writelines(lines) - + file.writelines(lines) + def deployment_part(version): """ Update helm file of preprod on deployment repository numerique-gouv/lasuite-deploiement """