Skip to content

Commit c8765df

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

File tree

3 files changed

+49
-65
lines changed

3 files changed

+49
-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

+46-64
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,36 @@ 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 PATH for virtual environment"
81+
run: |
82+
echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH
83+
84+
- name: "Update pip to the latest version"
85+
shell: pwsh
86+
run: |
87+
# .venv\Scripts\Activate.ps1
88+
python -m pip install -U pip
89+
7690
- name: "Install requirements"
77-
run: pip install -r requirements/requirements_build.txt
91+
shell: pwsh
92+
run: |
93+
# .venv\Scripts\Activate.ps1
94+
python -m pip install -r requirements/requirements_build.txt
7895

7996
- name: "Build the wheel"
80-
shell: bash
97+
shell: pwsh
8198
run: |
82-
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
83-
export platform="manylinux_2_17"
84-
else
85-
export platform="win"
86-
fi
99+
$os = "${{ matrix.os }}"
100+
if ($os -eq "ubuntu-latest") {
101+
$platform = "manylinux_2_17"
102+
} else {
103+
$platform = "win"
104+
}
105+
# .venv\Scripts\Activate.ps1
87106
python .ci/build_wheel.py -p $platform -w
88107

89108
- name: "Expose the wheel"
@@ -96,9 +115,10 @@ jobs:
96115
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
97116
98117
- name: "Install package wheel"
99-
shell: bash
118+
shell: pwsh
100119
run: |
101-
pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
120+
# .venv\Scripts\Activate.ps1
121+
python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
102122

103123
- name: "Install DPF"
104124
id: set-server-path
@@ -112,9 +132,11 @@ jobs:
112132
uses: ansys/pydpf-actions/[email protected]
113133

114134
- name: "Test import"
115-
shell: bash
135+
shell: pwsh
116136
working-directory: tests
117-
run: python -c "from ansys.dpf import core"
137+
run: |
138+
# ..\.venv\Scripts\Activate.ps1
139+
python -c "from ansys.dpf import core"
118140

119141
- name: "Setup headless display"
120142
uses: pyvista/setup-headless-display-action@v2
@@ -127,73 +149,33 @@ jobs:
127149
choco install pandoc
128150
129151
- name: "Install documentation packages for Python"
152+
shell: pwsh
130153
run: |
131-
pip install -r requirements/requirements_docs.txt
154+
# .venv\Scripts\Activate.ps1
155+
python -m pip install -r requirements/requirements_docs.txt
132156

133157
- name: "Kill all servers"
134158
uses: ansys/pydpf-actions/[email protected]
135159

136160
- name: "Ensure VTK compatibility"
161+
shell: pwsh
137162
run: |
163+
# .venv\Scripts\Activate.ps1
138164
python -m pip uninstall --yes vtk
139165
python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
140166

141167
- name: "List installed packages"
142-
shell: bash
143-
run: pip list
168+
shell: pwsh
169+
run: |
170+
# .venv\Scripts\Activate.ps1
171+
python -m pip list
144172

145173
- name: "Build HTML Documentation"
146-
shell: bash
174+
shell: cmd /D /E:ON /V:OFF /C "CALL "{0}""
175+
working-directory: .ci
147176
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"
177+
# ..\.venv\Scripts\activate.bat
178+
build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
197179
timeout-minutes: 60
198180
env:
199181
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)