From 9fea93e864f57edfdaddd51339c797e307cb3b87 Mon Sep 17 00:00:00 2001 From: Kim Neunert Date: Tue, 21 May 2024 16:53:46 +0200 Subject: [PATCH] few updates and build fixes for windows --- .gitlab-ci.yml | 2 ++ pyinstaller/requirements.in | 2 +- pyinstaller/requirements.txt | 18 +++++++------- pyproject.toml | 4 +-- utils/release-helper.py | 47 ++++++++++++++---------------------- 5 files changed, 32 insertions(+), 41 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae732b2898..3daf0ea2a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -111,6 +111,8 @@ release_binary_windows: stage: releasing only: - tags + variables: + GIT_DEPTH: 0 # Disable shallow clone to get all Git history tags: - windows before_script: diff --git a/pyinstaller/requirements.in b/pyinstaller/requirements.in index ffc6f7735b..aa002f1737 100644 --- a/pyinstaller/requirements.in +++ b/pyinstaller/requirements.in @@ -2,5 +2,5 @@ pyinstaller==5.2 pefile==2022.5.30 macholib pywin32-ctypes -babel==2.10.1 +babel==2.12.1 pytz==2022.1 diff --git a/pyinstaller/requirements.txt b/pyinstaller/requirements.txt index 33bda39fe3..2c94e1649a 100644 --- a/pyinstaller/requirements.txt +++ b/pyinstaller/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # # pip-compile --generate-hashes requirements.in # @@ -10,9 +10,9 @@ altgraph==0.17 \ # via # macholib # pyinstaller -babel==2.10.1 \ - --hash=sha256:3f349e85ad3154559ac4930c3918247d319f21910d5ce4b25d439ed8693b98d2 \ - --hash=sha256:98aeaca086133efb3e1e2aad0396987490c8425929ddbcfe0550184fdc54cd13 +babel==2.12.1 \ + --hash=sha256:b4246fb7677d3b98f501a39d43396d3cafdc8eadb045f4a31be01863f655c610 \ + --hash=sha256:cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455 # via -r requirements.in future==0.18.2 \ --hash=sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d @@ -20,7 +20,9 @@ future==0.18.2 \ macholib==1.14 \ --hash=sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432 \ --hash=sha256:c500f02867515e6c60a27875b408920d18332ddf96b4035ef03beddd782d4281 - # via -r requirements.in + # via + # -r requirements.in + # pyinstaller pefile==2022.5.30 \ --hash=sha256:a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b # via -r requirements.in @@ -44,9 +46,7 @@ pyinstaller-hooks-contrib==2022.8 \ pytz==2022.1 \ --hash=sha256:1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7 \ --hash=sha256:e68985985296d9a66a881eb3193b0906246245294a881e7c8afe623866ac6a5c - # via - # -r requirements.in - # babel + # via -r requirements.in pywin32-ctypes==0.2.0 \ --hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 \ --hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 diff --git a/pyproject.toml b/pyproject.toml index 819fe98773..7a477e19ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ "setuptools<=65.7.0", - "setuptools_scm[toml]>=6.2", - "babel==2.11.0", + "setuptools_scm[toml]>=6.4.2", + "babel==2.12.1", "build==0.10.0", "wheel", "twine" diff --git a/utils/release-helper.py b/utils/release-helper.py index 8231e68f42..fd9f5bf14d 100644 --- a/utils/release-helper.py +++ b/utils/release-helper.py @@ -6,6 +6,7 @@ import sys import zipfile from pathlib import Path +from glob import glob logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO) @@ -340,36 +341,24 @@ def sha256sum(filenames): # Used by build-win.ci.bat sha256sum(sys.argv[2:]) exit(0) - if "set_setup_py_version" in sys.argv: - # Used by build-win.ci.bat - version = sys.argv[2] - print(f"setting version {version} in setup.py") - search_text = "vx.y.z-get-replaced-by-release-script" - - # creating a variable and storing the text - # that we want to add - replace_text = version - - # Opening our text file in read only - # mode using the open() function - with open(r"setup.py", "r") as file: - data = file.read() - data = data.replace(search_text, replace_text) - with open(r"setup.py", "w") as file: - file.write(data) - print("Done") - exit(0) if "install_wheel" in sys.argv: - # Used by build-win.ci.bat - version = sys.argv[2] - version = version.replace("v", "") - version = version.replace("-pre", "rc") - filename = f"cryptoadvance.specter-{version}-py3-none-any.whl" - cmd = f"pip3 install {Path('dist',filename)}" - res = os.system(cmd) - print(f"result of command: {cmd}") - print(res) - exit(res) + # List all .whl files in the 'dist' directory + wheel_files = glob( + str(Path("dist", "cryptoadvance.specter-*-py3-none-any.whl")) + ) + print("found those wheel files: " + str(wheel_files)) + + # Loop through the wheel files and install them + for wheel_file in wheel_files: + cmd = f"pip3 install {wheel_file}" + res = os.system(cmd) + print(f"Result of command: {cmd}") + print(res) + # If the installation fails, exit with the error code + if res != 0: + exit(res) + # Exit with a success code if all installations were successful + exit(0) rh = ReleaseHelper() rh.init_gitlab()