Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .ci/update_dpf_dependencies.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -45,24 +45,33 @@
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,
dst=destination,
dirs_exist_ok=True,
ignore=lambda directory, contents: ["__pycache__"] if directory[-5:] == "gate" else [],
)
print("Done updating ansys-dpf-gate")
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
print("Updating ansys.dpf.gatebin")
Expand All @@ -75,9 +84,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."
)
5 changes: 3 additions & 2 deletions .github/workflows/update_operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ 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/
rm -r src/ansys/dpf/gate/generated
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

Expand Down