harbor run -t openthoughts/tasktrove-swe-rebench-patched-oracle-swe_rebench-05406harbor download openthoughts/tasktrove-swe-rebench-patched-oracle-swe_rebench-05406cd /testbed
git clone https://github.com/sphinx-gallery/sphinx-gallery.git . && git checkout 215e039e758546acd9a18e25361ca46f99303140
apt-get update
apt-get install -y gcc
pip install -r /setup_files/requirements.txt
pip install -e .[dev]
Minigallery directive file checking It's unclear what we want to be checking with:
It seems originally the check was for cases where dirs > 1 (see https://github.com/sphinx-gallery/sphinx-gallery/pull/1226#discussion_r1416586216) BUT we don't seem to be able to make this happen (see https://github.com/sphinx-gallery/sphinx-gallery/pull/1355#issuecomment-2251500148). It would be great if we could work out what we are meant to be checking here but :shrug: if not.
We can reach this error by making dirs = 0. I think this check would be to ensure the glob files we find live in the examples file, which is a reasonable check to have.
Even this is not working though. Using ../../tinybuild/examples/*/*.py as a minigallery entry in tinybuild (as suggested: https://github.com/sphinx-gallery/sphinx-gallery/pull/1355#issuecomment-2251484364), dirs=0 even though the examples found do live within an examples_dirs. This is because '../../tinybuild/examples/*/*.py'.find('../examples/') gives -1.
We can fix this by amending the check to:
if (obj.find(Path(e).name) != -1)
BUT then we get this error:
ValueError: '/home/<>/sphinx-gallery/sphinx_gallery/tests/tinybuild/doc/../../tinybuild/examples_README_header/plot_exp.py' is not in the subpath of '/home/<>/sphinx-gallery/sphinx_gallery/tests/tinybuild/doc/../examples' OR one path is relative and the other is absolute.
If I recall correctly, @story645 , we wanted to keep the glob paths we find to be relative, to allow sorting. BUT can we pass the relative paths to the sortkey but use abs paths otherwise in the directive? I think this would make the above check (ensuring the glob paths found live within an examples_dir) much easier/better as well as avoiding errors like the one above.
Would you be up for tacking this? I have spent more time than I should on SG :grimacing: