Skip to content

Commit 6c2b587

Browse files
committed
fix: trialing another fix
1 parent 284c7a6 commit 6c2b587

File tree

3 files changed

+45
-65
lines changed

3 files changed

+45
-65
lines changed

.ci/build_doc.bat

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@echo off
2+
13
REM Move to the documentation directory
24
pushd .
35
cd ../doc/

.github/workflows/docs.yml

+42-64
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,32 @@ jobs:
7373
with:
7474
python-version: ${{ inputs.python_version }}
7575

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+
7686
- 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
7891
7992
- name: "Build the wheel"
80-
shell: bash
93+
shell: pwsh
8194
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
87102
python .ci/build_wheel.py -p $platform -w
88103
89104
- name: "Expose the wheel"
@@ -96,9 +111,10 @@ jobs:
96111
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
97112
98113
- name: "Install package wheel"
99-
shell: bash
114+
shell: pwsh
100115
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]
102118
103119
- name: "Install DPF"
104120
id: set-server-path
@@ -112,9 +128,11 @@ jobs:
112128
uses: ansys/pydpf-actions/[email protected]
113129

114130
- name: "Test import"
115-
shell: bash
131+
shell: pwsh
116132
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"
118136
119137
- name: "Setup headless display"
120138
uses: pyvista/setup-headless-display-action@v2
@@ -127,73 +145,33 @@ jobs:
127145
choco install pandoc
128146
129147
- name: "Install documentation packages for Python"
148+
shell: pwsh
130149
run: |
131-
pip install -r requirements/requirements_docs.txt
150+
.venv\Scripts\Activate.ps1
151+
python -m pip install -r requirements/requirements_docs.txt
132152
133153
- name: "Kill all servers"
134154
uses: ansys/pydpf-actions/[email protected]
135155

136156
- name: "Ensure VTK compatibility"
157+
shell: pwsh
137158
run: |
159+
.venv\Scripts\Activate.ps1
138160
python -m pip uninstall --yes vtk
139161
python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
140162
141163
- 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
144168
145169
- name: "Build HTML Documentation"
146-
shell: bash
170+
shell: cmd /D /E:ON /V:OFF /C "CALL "{0}""
171+
working-directory: .ci
147172
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
197175
timeout-minutes: 60
198176
env:
199177
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}

requirements/requirements_docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nbsphinx==0.9.5
88
pypandoc==1.14
99
pytest-sphinx==0.6.3
1010
pyvista==0.44.2
11-
sphinx==8.1.3
11+
sphinx==7.4.7
1212
sphinx-copybutton==0.5.2
1313
sphinx-gallery==0.18.0
1414
sphinx-notfound-page==1.0.4

0 commit comments

Comments
 (0)