ENH: Add metadata for parallel_read_safe = True #148
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #146
This PR adds
return {"parallel_read_safe": True}tosetupinjupyterlite_sphinx.py, markingjupyterlite_sphinxas parallel read safe in the metadata.Without this, Sphinx forces a serial read
I've determined that the extension is parallel read safe. I think the only point of contention is the use of
self.env.temp_dataseen below, to avoid regenerating notebooks if a docstring is processed multiple times.jupyterlite-sphinx/jupyterlite_sphinx/jupyterlite_sphinx.py
Lines 375 to 381 in 09be958
and later on
jupyterlite-sphinx/jupyterlite_sphinx/jupyterlite_sphinx.py
Lines 408 to 409 in 09be958
Since the keys in the dictionary are unique per appearance of the directive, and the only operations are setting for a key if the key doesn't exist, or checking if the key is in the dictionary, parallel reads should have no impact. I've tested this building SciPy's documentation with parallel reading, and found no issues.