Skip to content

Commit f10c572

Browse files
PProfiziansys-akarcher
authored andcommitted
maint(ci): Update tox.ini doc clean environment (#2376)
1 parent 45cadd3 commit f10c572

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

tox.ini

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -229,29 +229,23 @@ commands =
229229
clean: python -c "import shutil, sys; shutil.rmtree(sys.argv[1], ignore_errors=True)" "{toxinidir}/{env:BUILD_DIR}"
230230

231231
# Clean files from previous build
232-
html: python -c "\
233-
html: from os.path import exists; import shutil; \
234-
html: [(shutil.rmtree(p) if exists(p) else None) for p in ['{env:SOURCE_DIR}/images/auto-generated']]; \
235-
html: [(shutil.move(src, dst) if exists(src) else None) for src, dst in \
236-
html: [('{env:SOURCE_DIR}/examples/07-python-operators/plugins', '{env:SOURCE_DIR}/_temp/plugins'), \
237-
html: ('{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress', '{env:SOURCE_DIR}/_temp/04_advanced'), \
238-
html: ('{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results', '{env:SOURCE_DIR}/_temp/12_fluids')]]; \
239-
html: [shutil.rmtree(p) for p in ['{env:SOURCE_DIR}/examples'] if exists(p)]; \
240-
html: [(shutil.move(src, dst) if exists(src) else None) for src, dst in \
241-
html: [('{env:SOURCE_DIR}/_temp/plugins', '{env:SOURCE_DIR}/examples/07-python-operators/plugins'), \
242-
html: ('{env:SOURCE_DIR}/_temp/04_advanced', '{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress'), \
243-
html: ('{env:SOURCE_DIR}/_temp/12_fluids', '{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results')]]; \
244-
html: [shutil.rmtree(p) for p in ['{env:SOURCE_DIR}/_temp'] if exists(p)]"
232+
clean: python -c "\
233+
clean: from os.path import exists; import shutil; \
234+
clean: [(shutil.rmtree(p) if exists(p) else None) for p in ['{env:SOURCE_DIR}/images/auto-generated']]; \
235+
clean: [(shutil.move(src, dst) if exists(src) else None) for src, dst in \
236+
clean: [('{env:SOURCE_DIR}/examples/07-python-operators/plugins', '{env:SOURCE_DIR}/_temp/plugins'), \
237+
clean: ('{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress', '{env:SOURCE_DIR}/_temp/04_advanced'), \
238+
clean: ('{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results', '{env:SOURCE_DIR}/_temp/12_fluids')]]; \
239+
clean: [shutil.rmtree(p) for p in ['{env:SOURCE_DIR}/examples'] if exists(p)]; \
240+
clean: [(shutil.move(src, dst) if exists(src) else None) for src, dst in \
241+
clean: [('{env:SOURCE_DIR}/_temp/plugins', '{env:SOURCE_DIR}/examples/07-python-operators/plugins'), \
242+
clean: ('{env:SOURCE_DIR}/_temp/04_advanced', '{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress'), \
243+
clean: ('{env:SOURCE_DIR}/_temp/12_fluids', '{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results')]]; \
244+
clean: [shutil.rmtree(p) for p in ['{env:SOURCE_DIR}/_temp'] if exists(p)]"
245245

246246
# Build documentation
247247
html,links: {env_bin_dir}/sphinx-build -b {env:BUILDER} {env:SOURCE_DIR} {env:BUILD_DIR}/{env:BUILDER} {env:BUILDER_OPTS}
248248

249-
# Patch pyVista issue with elemental plots by copying necessary images
250-
html: python -c "\
251-
html: import os, shutil, glob; os.makedirs('build/html/_images', exist_ok=True); \
252-
html: [(shutil.copy(src, 'build/html/_images') if os.path.exists(src) else print(f'Source not found: {src}')) for src in \
253-
html: glob.glob('{env:SOURCE_DIR}/examples/04-advanced/02-volume_averaged_stress/*') + glob.glob('{env:SOURCE_DIR}/examples/12-fluids/02-fluids_results/*')]"
254-
255249
commands_post =
256250
# Clear any running servers that may be locking resources
257251
html,links: python -c "import psutil; proc_name = 'Ans.Dpf.Grpc'; nb_procs = len([proc.kill() for proc in psutil.process_iter() if proc_name in proc.name()]); \

0 commit comments

Comments
 (0)