@@ -73,17 +73,32 @@ jobs:
73
73
with :
74
74
python-version : ${{ inputs.python_version }}
75
75
76
+ - name : " Create virtual environment in the current workspace"
77
+ shell : pwsh
78
+ run : python -m venv .venv --system-site-packages
79
+
80
+ - name : " Update pip to the latest version"
81
+ shell : pwsh
82
+ run : |
83
+ .venv\Scripts\Activate.ps1
84
+ python -m pip install -U pip
85
+
76
86
- name : " Install requirements"
77
- run : pip install -r requirements/requirements_build.txt
87
+ shell : pwsh
88
+ run : |
89
+ .venv\Scripts\Activate.ps1
90
+ python -m pip install -r requirements/requirements_build.txt
78
91
79
92
- name : " Build the wheel"
80
- shell : bash
93
+ shell : pwsh
81
94
run : |
82
- if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
83
- export platform="manylinux_2_17"
84
- else
85
- export platform="win"
86
- fi
95
+ $os = "${{ matrix.os }}"
96
+ if ($os -eq "ubuntu-latest") {
97
+ $platform = "manylinux_2_17"
98
+ } else {
99
+ $platform = "win"
100
+ }
101
+ .venv\Scripts\Activate.ps1
87
102
python .ci/build_wheel.py -p $platform -w
88
103
89
104
- name : " Expose the wheel"
@@ -96,9 +111,10 @@ jobs:
96
111
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
97
112
98
113
- name : " Install package wheel"
99
- shell : bash
114
+ shell : pwsh
100
115
run : |
101
- pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
116
+ .venv\Scripts\Activate.ps1
117
+ python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
102
118
103
119
- name : " Install DPF"
104
120
id : set-server-path
@@ -112,9 +128,11 @@ jobs:
112
128
uses :
ansys/pydpf-actions/[email protected]
113
129
114
130
- name : " Test import"
115
- shell : bash
131
+ shell : pwsh
116
132
working-directory : tests
117
- run : python -c "from ansys.dpf import core"
133
+ run : |
134
+ ..\.venv\Scripts\Activate.ps1
135
+ python -c "from ansys.dpf import core"
118
136
119
137
- name : " Setup headless display"
120
138
uses : pyvista/setup-headless-display-action@v2
@@ -127,73 +145,33 @@ jobs:
127
145
choco install pandoc
128
146
129
147
- name : " Install documentation packages for Python"
148
+ shell : pwsh
130
149
run : |
131
- pip install -r requirements/requirements_docs.txt
150
+ .venv\Scripts\Activate.ps1
151
+ python -m pip install -r requirements/requirements_docs.txt
132
152
133
153
- name : " Kill all servers"
134
154
uses :
ansys/pydpf-actions/[email protected]
135
155
136
156
- name : " Ensure VTK compatibility"
157
+ shell : pwsh
137
158
run : |
159
+ .venv\Scripts\Activate.ps1
138
160
python -m pip uninstall --yes vtk
139
161
python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
140
162
141
163
- name : " List installed packages"
142
- shell : bash
143
- run : pip list
164
+ shell : pwsh
165
+ run : |
166
+ .venv\Scripts\Activate.ps1
167
+ python -m pip list
144
168
145
169
- name : " Build HTML Documentation"
146
- shell : bash
170
+ shell : cmd /D /E:ON /V:OFF /C "CALL "{0}""
171
+ working-directory : .ci
147
172
run : |
148
- # Navigate to the documentation directory
149
- cd doc
150
-
151
- # Create a log file for output redirection
152
- LOG_FILE="../doc/log.txt"
153
- exec > >(tee -a "$LOG_FILE") 2>&1
154
-
155
- echo "Starting documentation build process..."
156
-
157
- # Backup files from source/examples and source/_temp/plugins before cleaning
158
- echo "Backing up files before cleaning..."
159
- mkdir -p source/_backup
160
- [ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true
161
- [ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true
162
- [ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true
163
-
164
- # Clean previous builds
165
- echo "Cleaning previous build artifacts..."
166
- rm -rf build source/images/auto-generated source/examples
167
- rm -rf source/_temp || true
168
-
169
- # Restore backed-up files
170
- echo "Restoring backed-up files..."
171
- mkdir -p source/examples/07-python-operators
172
- [ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true
173
- mkdir -p source/examples/04-advanced
174
- [ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true
175
- mkdir -p source/examples/12-fluids
176
- [ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true
177
- rm -rf source/_backup || true
178
-
179
- # Build the HTML documentation
180
- echo "Building HTML documentation..."
181
- sphinx-build -b html source build/html -v
182
-
183
- # Copy necessary images to the build directory
184
- echo "Copying images for patching pyVista issues..."
185
- mkdir -p build/html/_images
186
- cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true
187
- cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true
188
- cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true
189
-
190
- # Verify the output
191
- echo "Documentation build completed. Verifying contents..."
192
- ls -R build/html
193
-
194
- # Display the log file content
195
- echo "Displaying the log file content..."
196
- cat "$LOG_FILE"
173
+ ..\.venv\Scripts\activate.bat
174
+ build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
197
175
timeout-minutes : 60
198
176
env :
199
177
MEILISEARCH_PUBLIC_API_KEY : ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
0 commit comments