From d197a50fe233b1cb4706e442ecd5c6d62ffb7aa8 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 4 Sep 2024 10:12:40 +0200 Subject: [PATCH 1/5] Limit the automatic update of ansys/dpf/gate to the 'generated' folder Signed-off-by: paul.profizi --- .github/workflows/update_operators.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_operators.yml b/.github/workflows/update_operators.yml index 561ba688a9d..1f9d190e225 100644 --- a/.github/workflows/update_operators.yml +++ b/.github/workflows/update_operators.yml @@ -66,10 +66,10 @@ jobs: run: | wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_dpf_gate-*" -type f) echo $wheel_file - rm -r src/ansys/dpf/gate - unzip -o $wheel_file "ansys/**/*" -d src/ - chmod -R 777 src/ansys/dpf/gate - git add -f src/ansys/dpf/gate + rm -r src/ansys/dpf/gate/generated + unzip -o $wheel_file "ansys/dpf/gate/generated/*" -d src/ansys/dpf/gate/generated + chmod -R 777 src/ansys/dpf/gate/generated + git add -f src/ansys/dpf/gate/generated - name: "Update ansys-dpf-gatebin lin" shell: bash From 6ccb6c4d43d5e01029d648a91859dab3a177b3cf Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 4 Sep 2024 10:13:20 +0200 Subject: [PATCH 2/5] Limit the manual update of ansys/dpf/gate to the 'generated' folder in update_dpf_dependencies.py Signed-off-by: paul.profizi --- .ci/update_dpf_dependencies.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.ci/update_dpf_dependencies.py b/.ci/update_dpf_dependencies.py index 4061098cc83..cf4cb9222f7 100644 --- a/.ci/update_dpf_dependencies.py +++ b/.ci/update_dpf_dependencies.py @@ -1,4 +1,4 @@ -"""Script to update ansys-dpf-gate, ansys-dpf-gatebin and ansys-grpc-dpf based on repositories +"""Script to update ansys.dpf.gate.generated, ansys.dpf.gatebin and ansys.grpc.dpf. This script should only be used to quickly test changes to any of these dependencies. Actual commit of updated code should not occur. @@ -45,16 +45,16 @@ file, path=destination, ) - print("Done updating ansys-grpc-dpf") + print("Done updating ansys.grpc.dpf") else: print(f"{grpc_path_key} environment variable is not defined. " "Cannot update ansys-grpc-dpf.") if gate_path is not None: # Update ansys-dpf-gate - print("Updating ansys.dpf.gate") - dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys") + print("Updating ansys.dpf.gate generated code") + dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys", "dpf", "gate", "generated") print(f"from {dist_path}") - destination = os.path.join(core_path, "src", "ansys") + destination = os.path.join(core_path, "src", "ansys", "dpf", "gate", "generated") print(f"into {destination}") shutil.copytree( src=dist_path, @@ -62,7 +62,7 @@ dirs_exist_ok=True, ignore=lambda directory, contents: ["__pycache__"] if directory[-5:] == "gate" else [], ) - print("Done updating ansys-dpf-gate") + print("Done updating ansys.dpf.gate generated code") # Update ansys-dpf-gatebin print("Updating ansys.dpf.gatebin") @@ -75,9 +75,9 @@ dst=destination, dirs_exist_ok=True, ) - print(f"Done updating ansys-dpf-gatebin for {platform.system()}") + print(f"Done updating ansys.dpf.gatebin for {platform.system()}") else: print( f"{gate_path_key} environment variable is not defined. " - "Cannot update ansys-dpf-gate or ansys-dpf-gatebin." + "Cannot update ansys.dpf.gate or ansys.dpf.gatebin." ) From 21166c3d2a87143f1fd60b335a481ee76c5cc468 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 4 Sep 2024 10:41:07 +0200 Subject: [PATCH 3/5] Add ansys/dpf/gate/__init_.py to updated files Signed-off-by: paul.profizi --- .ci/update_dpf_dependencies.py | 9 +++++++++ .github/workflows/update_operators.yml | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.ci/update_dpf_dependencies.py b/.ci/update_dpf_dependencies.py index cf4cb9222f7..4c301cd51e5 100644 --- a/.ci/update_dpf_dependencies.py +++ b/.ci/update_dpf_dependencies.py @@ -62,6 +62,15 @@ dirs_exist_ok=True, ignore=lambda directory, contents: ["__pycache__"] if directory[-5:] == "gate" else [], ) + dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys", "dpf", "gate", "__init__.py") + print(f"from {dist_path}") + destination = os.path.join(core_path, "src", "ansys", "dpf", "gate", "__init__.py") + print(f"into {destination}") + shutil.copytree( + src=dist_path, + dst=destination, + dirs_exist_ok=True, + ) print("Done updating ansys.dpf.gate generated code") # Update ansys-dpf-gatebin diff --git a/.github/workflows/update_operators.yml b/.github/workflows/update_operators.yml index 1f9d190e225..0f477d92b0c 100644 --- a/.github/workflows/update_operators.yml +++ b/.github/workflows/update_operators.yml @@ -68,8 +68,9 @@ jobs: echo $wheel_file rm -r src/ansys/dpf/gate/generated unzip -o $wheel_file "ansys/dpf/gate/generated/*" -d src/ansys/dpf/gate/generated - chmod -R 777 src/ansys/dpf/gate/generated - git add -f src/ansys/dpf/gate/generated + unzip -o $wheel_file "ansys/dpf/gate/__init__.py" -d src/ansys/dpf/gate + chmod -R 777 src/ansys/dpf/gate + git add -f src/ansys/dpf/gate - name: "Update ansys-dpf-gatebin lin" shell: bash From 4de30d2c6f98dbccfe47c0ed77c6fb282910b926 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 4 Sep 2024 10:49:12 +0200 Subject: [PATCH 4/5] Fix unzip destination Signed-off-by: paul.profizi --- .github/workflows/update_operators.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_operators.yml b/.github/workflows/update_operators.yml index 0f477d92b0c..0236e94efcf 100644 --- a/.github/workflows/update_operators.yml +++ b/.github/workflows/update_operators.yml @@ -67,8 +67,8 @@ jobs: wheel_file=$(find ./dpf-standalone/v${{ github.event.inputs.ANSYS_VERSION }}/dist -name "ansys_dpf_gate-*" -type f) echo $wheel_file rm -r src/ansys/dpf/gate/generated - unzip -o $wheel_file "ansys/dpf/gate/generated/*" -d src/ansys/dpf/gate/generated - unzip -o $wheel_file "ansys/dpf/gate/__init__.py" -d src/ansys/dpf/gate + unzip -o $wheel_file "ansys/dpf/gate/generated/*" -d src/ + unzip -o $wheel_file "ansys/dpf/gate/__init__.py" -d src/ chmod -R 777 src/ansys/dpf/gate git add -f src/ansys/dpf/gate From dabd9a1f51ee19cb336e8e74de6aa6f09764b58b Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Thu, 5 Sep 2024 13:45:57 +0200 Subject: [PATCH 5/5] Fix gate/__init__.py copy Signed-off-by: paul.profizi --- .ci/update_dpf_dependencies.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/update_dpf_dependencies.py b/.ci/update_dpf_dependencies.py index 4c301cd51e5..5dc6fdddaa8 100644 --- a/.ci/update_dpf_dependencies.py +++ b/.ci/update_dpf_dependencies.py @@ -66,10 +66,9 @@ print(f"from {dist_path}") destination = os.path.join(core_path, "src", "ansys", "dpf", "gate", "__init__.py") print(f"into {destination}") - shutil.copytree( + shutil.copy( src=dist_path, dst=destination, - dirs_exist_ok=True, ) print("Done updating ansys.dpf.gate generated code")