BUG: Fix serialization with Sphinx 7.3#1289
Conversation
|
@maxnoe can you see if the documented changes here make sense to you? |
|
@lucyleeow ready for review/merge from my end |
lucyleeow
left a comment
There was a problem hiding this comment.
Thank you for fixing this, does not look like it was a simple fix. Lots of nits that can be fixed later really.
|
while working on the same issue at matplotlib i made some changes in gen_gallery and gen_rst to handle the issue with
|
|
I'll probably try modifying it just to use _get_callables instead so that a callable needs to be passed rather than a class |
|
Pushed a commit, feel free to give it a try / another look @NirobNabil @lucyleeow ! |
sphinx_gallery/gen_rst.py
Outdated
|
|
||
|
|
||
| def _get_callables(gallery_conf, key): | ||
| # the following should be the case (internal use only) |
There was a problem hiding this comment.
Not sure what this means.
Maybe we could add a docstring one liner?
There was a problem hiding this comment.
it refers to the following assert line which should always pass because we've ensured it elsewhere
Co-authored-by: Lucy Liu <jliu176@gmail.com>
Co-authored-by: Lucy Liu <jliu176@gmail.com>
Co-authored-by: Lucy Liu <jliu176@gmail.com>
|
Been waiting for this PR to go into a release so that the fix at matplotlib can be merged. Any idea when the next release window of sphinx-gallery might be? |
|
We'll release after this PR goes in. Edit: |
lucyleeow
left a comment
There was a problem hiding this comment.
Haven't looked deeply in the tests but should we parametrize some to test config value being str and callable (since we still want to support callable atm). Can be done in separate PR. I guess we would eventually remove callable support if Sphinx moves to toml conf file.
Thanks for fixing this, not an easy one.
|
@lucyleeow are you up for pushing directly? I think it will be faster |
|
Can be done in separate PR but what do you think about just updating the |
Done, only changed docs. |
I wish we could but the env (including gallery conf) is cached after SG runs so it would cause the same serializing problems |
|
Ah I didn't realise that. Can't see a way around that. Feel free to merge! |
|
Ah I forgot about the tests, I can update in a separate PR. |
|
Yeah let's get this in and I can start testing with MNE-Python for example. Then maybe release Friday? |
Just a question, as I was just thinking about this. When you say after SG runs, does it mean more generally after build? As I understand, we connect functions to various sphinx events, so 'after SG runs' would just mean after sphinx finishes building? Or am I mis-understanding? |
|
I mean after the examples are run in the |
Closes #1286
"FileNameSortKey"as an alias for"sphinx_gallery.sorting.FileNameSortKey"sphinx_gallery_confclean: don't storeappin there or any functionsKind of a pain to figure out but ultimately it does seem cleaner!