From ebc3dd8bf368bf2579a8c5b5add1db049f3e97ee Mon Sep 17 00:00:00 2001 From: corey Date: Sun, 5 Nov 2023 14:48:39 -0600 Subject: [PATCH] WiP: publishing --- python/origen/build_helpers/__init__.py | 14 ++++++++++++-- python/origen/poetry_build.py | 4 +++- python/origen_metal/poetry_build.py | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/python/origen/build_helpers/__init__.py b/python/origen/build_helpers/__init__.py index e66f1cda..5d1c4275 100644 --- a/python/origen/build_helpers/__init__.py +++ b/python/origen/build_helpers/__init__.py @@ -8,8 +8,8 @@ publish_step = True else: publish_step = \ - os.getenv("GITHUB_WORKFLOW", "") == "publish" \ - or "PEP517_BUILD_BACKEND" not in os.environ + os.getenv("GITHUB_WORKFLOW", "") == "publish" + # or "PEP517_BUILD_BACKEND" not in os.environ def compile_rust(dir, target=None, workspace=False): cmd = ['cargo', 'build'] @@ -28,3 +28,13 @@ def compile_rust(dir, target=None, workspace=False): if compile_result.returncode != 0: print(f"Failed to build target from {dir}. Received return code {compile_result.returncode}") exit(1) + +def ls_dir(dir): + print(f"Showing directory: {dir}") + subprocess.run( + ["dir" if windows else "ls"], + stderr=sys.stderr, + stdout=sys.stdout, + cwd=dir, + shell=windows, + ) diff --git a/python/origen/poetry_build.py b/python/origen/poetry_build.py index 0697cc4c..8f544275 100644 --- a/python/origen/poetry_build.py +++ b/python/origen/poetry_build.py @@ -1,5 +1,5 @@ import pathlib, shutil, os -from build_helpers import windows, compile_rust, publish_step +from build_helpers import windows, compile_rust, publish_step, ls_dir if __name__ == '__main__': if publish_step: @@ -27,6 +27,7 @@ compile_rust(origen_cli_src, rust_build_target, True) if copy_cli: print(f"Copying CLI for packaging from ({origen_cli_target} to {origen_cli_pkg_dir})") + ls_dir(origen_cli_target.parent) shutil.copy2(origen_cli_target, origen_cli_pkg_dir) # Build and copy Origen library @@ -34,6 +35,7 @@ compile_rust(origen_lib_src, rust_build_target, False) if copy_lib: print(f"Copying CLI for packaging ({origen_lib_target} to {origen_pkg_lib})") + ls_dir(origen_lib_target.parent) shutil.copy2(origen_lib_target, origen_pkg_lib) print("Libraries built!") else: diff --git a/python/origen_metal/poetry_build.py b/python/origen_metal/poetry_build.py index 26aa856b..d6504652 100644 --- a/python/origen_metal/poetry_build.py +++ b/python/origen_metal/poetry_build.py @@ -1,7 +1,7 @@ import pathlib, shutil, os, sys sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.joinpath("origen"))) -from build_helpers import windows, compile_rust, publish_step +from build_helpers import windows, compile_rust, publish_step, ls_dir if __name__ == '__main__': if publish_step: @@ -22,6 +22,7 @@ compile_rust(om_lib_src, rust_build_target, False) if copy_build_target: print(f"Copying compiled library '{om_lib_target}' to '{om_lib}'") + ls_dir(om_lib_target.parent) shutil.copy2(om_lib_target, om_lib) # Final check that compiled library is present