From a155a1ca80feb8862dac2c27c43753dfc8a14026 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Thu, 16 Jul 2026 18:19:58 +0300 Subject: [PATCH] Fix ci-bonsai-choco: choco_release.py still targets the old choco/blenderbim path The choco dir was renamed from choco/blenderbim to choco/bonsai back in 2024 (Rename choco dir), but choco_release.py's BLENDERBIM_DIR constant was never updated, so the daily choco release job crashes immediately with FileNotFoundError trying to os.chdir into the now nonexistent choco/blenderbim directory. Release tags also moved from a bare blenderbim-YYMMDD scheme to bonsai-X.Y.Z-alphaYYMMDDHHMM, so the tag-prefix strip used to build the package version still looked for the old "blenderbim-" prefix and left it untouched, embedding the raw tag (including the already-present "-alpha" segment) into the nuspec version field, which the template then doubled up with its own "-alpha" suffix, producing an invalid NuGet version string. Both are fixed together since the second bug would otherwise surface as soon as the first one is unblocked. The pre-commit black hook also reformatted pre-existing whitespace drift in choco_release.py (this file sits outside CI's lint scope, so it had never been auto-formatted before); that reformatting is incidental to satisfying the local hook, not part of the fix itself. Generated with the assistance of an AI coding tool. --- choco/bonsai/blenderbim.nuspec | 2 +- choco/bonsai/choco_release.py | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/choco/bonsai/blenderbim.nuspec b/choco/bonsai/blenderbim.nuspec index a6ca7b107d..c769b698dd 100644 --- a/choco/bonsai/blenderbim.nuspec +++ b/choco/bonsai/blenderbim.nuspec @@ -3,7 +3,7 @@ blenderbim-nightly - blenderbim_build_version-alpha + blenderbim_build_version https://github.com/IfcOpenShell/IfcOpenShell fbpyr diff --git a/choco/bonsai/choco_release.py b/choco/bonsai/choco_release.py index ea53798c5d..0521ed4d6b 100644 --- a/choco/bonsai/choco_release.py +++ b/choco/bonsai/choco_release.py @@ -3,11 +3,12 @@ apt update && apt install git wget curl ptpython mono-devel micro mkdir -p /home/runner/work/IfcOpenShell && cd /home/runner/work/IfcOpenShell git clone https://github.com/IfcOpenShell/IfcOpenShell -cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/ +cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/bonsai/ micro choco_release.py # paste this script, comment out push command export CHOCO_TOKEN="secret_choco_release_token" python3 choco_release.py """ + import datetime import hashlib import os @@ -28,7 +29,7 @@ def get_repo_tag_names() -> list[str]: def request_repo_info(url: str): - req = request.Request(url) + req = request.Request(url) resp = request.urlopen(req) if not resp.status == 200: print(f"[ERROR] could not contact server: {url}") @@ -85,13 +86,15 @@ def run(command: str) -> None: start = datetime.datetime.now() -URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender" -URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake" -RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+Blender (\d+\.\d+)\..+" -RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+Blender (\d+\.\d+\.\d+)" +URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender" +URL_BLENDER_CMAKE = ( + "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake" +) +RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+Blender (\d+\.\d+)\..+" +RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+Blender (\d+\.\d+\.\d+)" RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)" -BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/") +BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/bonsai/") print("_____ check choco release needed?") @@ -148,7 +151,7 @@ print(f"{blender_python_version_maj_min=}") python_version = f"py{found[0].replace('.', '')}" print(f"{python_version=}") -blenderbim_build_version = target_release_tag.replace("blenderbim-", "") +blenderbim_build_version = target_release_tag.replace("bonsai-", "") # url_blenderbim_py3x_win_zip release_zip_file_name, url_blenderbim_py3x_win_zip = get_release_zip(target_release_tag) @@ -166,15 +169,15 @@ topics = { "path": HERE_DIR / "blenderbim.nuspec", "key_values": { "latest_blender_version_maj_min_pat": latest_blender_release_maj_min_pat, - "blenderbim_build_version" : blenderbim_build_version, + "blenderbim_build_version": blenderbim_build_version, }, }, "install": { "path": HERE_DIR / "tools" / "chocolateyinstall.ps1", "key_values": { - "url_blenderbim_py3x_win_zip" : url_blenderbim_py3x_win_zip, + "url_blenderbim_py3x_win_zip": url_blenderbim_py3x_win_zip, "sha256sum_blenderbim_py3x_win_zip": sha256sum_blenderbim_py3x_win_zip, - "latest_blender_version_maj_min" : blender_version_min_maj, + "latest_blender_version_maj_min": blender_version_min_maj, }, }, "uninstall": {