|
6 | 6 | import sys |
7 | 7 | import zipfile |
8 | 8 | from pathlib import Path |
| 9 | +from glob import glob |
9 | 10 |
|
10 | 11 |
|
11 | 12 | logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO) |
@@ -340,36 +341,24 @@ def sha256sum(filenames): |
340 | 341 | # Used by build-win.ci.bat |
341 | 342 | sha256sum(sys.argv[2:]) |
342 | 343 | exit(0) |
343 | | - if "set_setup_py_version" in sys.argv: |
344 | | - # Used by build-win.ci.bat |
345 | | - version = sys.argv[2] |
346 | | - print(f"setting version {version} in setup.py") |
347 | | - search_text = "vx.y.z-get-replaced-by-release-script" |
348 | | - |
349 | | - # creating a variable and storing the text |
350 | | - # that we want to add |
351 | | - replace_text = version |
352 | | - |
353 | | - # Opening our text file in read only |
354 | | - # mode using the open() function |
355 | | - with open(r"setup.py", "r") as file: |
356 | | - data = file.read() |
357 | | - data = data.replace(search_text, replace_text) |
358 | | - with open(r"setup.py", "w") as file: |
359 | | - file.write(data) |
360 | | - print("Done") |
361 | | - exit(0) |
362 | 344 | if "install_wheel" in sys.argv: |
363 | | - # Used by build-win.ci.bat |
364 | | - version = sys.argv[2] |
365 | | - version = version.replace("v", "") |
366 | | - version = version.replace("-pre", "rc") |
367 | | - filename = f"cryptoadvance.specter-{version}-py3-none-any.whl" |
368 | | - cmd = f"pip3 install {Path('dist',filename)}" |
369 | | - res = os.system(cmd) |
370 | | - print(f"result of command: {cmd}") |
371 | | - print(res) |
372 | | - exit(res) |
| 345 | + # List all .whl files in the 'dist' directory |
| 346 | + wheel_files = glob( |
| 347 | + str(Path("dist", "cryptoadvance.specter-*-py3-none-any.whl")) |
| 348 | + ) |
| 349 | + print("found those wheel files: " + str(wheel_files)) |
| 350 | + |
| 351 | + # Loop through the wheel files and install them |
| 352 | + for wheel_file in wheel_files: |
| 353 | + cmd = f"pip3 install {wheel_file}" |
| 354 | + res = os.system(cmd) |
| 355 | + print(f"Result of command: {cmd}") |
| 356 | + print(res) |
| 357 | + # If the installation fails, exit with the error code |
| 358 | + if res != 0: |
| 359 | + exit(res) |
| 360 | + # Exit with a success code if all installations were successful |
| 361 | + exit(0) |
373 | 362 |
|
374 | 363 | rh = ReleaseHelper() |
375 | 364 | rh.init_gitlab() |
|
0 commit comments