|
1 | | -"""Script to update ansys-dpf-gate, ansys-dpf-gatebin and ansys-grpc-dpf based on repositories |
| 1 | +"""Script to update ansys.dpf.gate.generated, ansys.dpf.gatebin and ansys.grpc.dpf. |
2 | 2 |
|
3 | 3 | This script should only be used to quickly test changes to any of these dependencies. |
4 | 4 | Actual commit of updated code should not occur. |
|
12 | 12 | It will update the current repo |
13 | 13 | or the repo defined by the environment variable "ANSYSDPFCORE_ROOT" if it exists. |
14 | 14 | """ |
| 15 | + |
15 | 16 | import os |
16 | 17 | import glob |
17 | 18 | import pathlib |
|
45 | 46 | file, |
46 | 47 | path=destination, |
47 | 48 | ) |
48 | | - print("Done updating ansys-grpc-dpf") |
| 49 | + print("Done updating ansys.grpc.dpf") |
49 | 50 | else: |
50 | 51 | print(f"{grpc_path_key} environment variable is not defined. " "Cannot update ansys-grpc-dpf.") |
51 | 52 |
|
52 | 53 | if gate_path is not None: |
53 | 54 | # Update ansys-dpf-gate |
54 | | - print("Updating ansys.dpf.gate") |
55 | | - dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys") |
| 55 | + print("Updating ansys.dpf.gate generated code") |
| 56 | + dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys", "dpf", "gate", "generated") |
56 | 57 | print(f"from {dist_path}") |
57 | | - destination = os.path.join(core_path, "src", "ansys") |
| 58 | + destination = os.path.join(core_path, "src", "ansys", "dpf", "gate", "generated") |
58 | 59 | print(f"into {destination}") |
59 | 60 | shutil.copytree( |
60 | 61 | src=dist_path, |
61 | 62 | dst=destination, |
62 | 63 | dirs_exist_ok=True, |
63 | 64 | ignore=lambda directory, contents: ["__pycache__"] if directory[-5:] == "gate" else [], |
64 | 65 | ) |
65 | | - print("Done updating ansys-dpf-gate") |
| 66 | + dist_path = os.path.join(gate_path, "ansys-dpf-gate", "ansys", "dpf", "gate", "__init__.py") |
| 67 | + print(f"from {dist_path}") |
| 68 | + destination = os.path.join(core_path, "src", "ansys", "dpf", "gate", "__init__.py") |
| 69 | + print(f"into {destination}") |
| 70 | + shutil.copy( |
| 71 | + src=dist_path, |
| 72 | + dst=destination, |
| 73 | + ) |
| 74 | + print("Done updating ansys.dpf.gate generated code") |
66 | 75 |
|
67 | 76 | # Update ansys-dpf-gatebin |
68 | 77 | print("Updating ansys.dpf.gatebin") |
|
75 | 84 | dst=destination, |
76 | 85 | dirs_exist_ok=True, |
77 | 86 | ) |
78 | | - print(f"Done updating ansys-dpf-gatebin for {platform.system()}") |
| 87 | + print(f"Done updating ansys.dpf.gatebin for {platform.system()}") |
79 | 88 | else: |
80 | 89 | print( |
81 | 90 | f"{gate_path_key} environment variable is not defined. " |
82 | | - "Cannot update ansys-dpf-gate or ansys-dpf-gatebin." |
| 91 | + "Cannot update ansys.dpf.gate or ansys.dpf.gatebin." |
83 | 92 | ) |
0 commit comments