Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Plot directive: delegate file handling to Sphinx#24205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping@matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
I think this is going to move some files around in the final build. Do we expect that is going to cause trouble for anyone? |
MikhailRyazanov commentedOct 18, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes. Moreover, the paths will be unpredictable (they are generated by hashing file contents). I've already expressed this concern in#24005. However, at least the docs built for this PR look fine (I don't see any obvious problems). If somebody has a deeper understanding of Sphinx API, maybe an alternative solution can be found. Keep in mind, although, that it must:
|
@MikhailRyazanov Thanks for looking into this. Unfortunately, we might lack sphinx expertise to properly understand and solve this issue. - I have to admit, that the download-approach feels a bit hackish, but I don't have a better suggestion. So it might be that we'll have trouble coming up with a decision here.
While this all is reasonable would be nice, we do not necessarily need a 100% solution. Maybe that makes solving some parts easier. We could decide that |
MikhailRyazanov commentedOct 21, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@timhoffm, IMHO hackish is how this extension currently circumvents Sphinx mechanisms by copying files directly to the output tree (at a wrongbuild phase) and trying to generate links to them (based on incorrect assumptions). I would say that Basically, what do you think is wrong with using Regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Weakly in favor of taking this. Fixingsinglehtml
worth the risk of changed URLs.
@tacaswell, thanks for approving this!
As I wrote, it at least lets Sphinx itself to handle all the file management and thus avoid all the mentioned problems (when unneeded files are copied, needed files are not copied, and wrong links are generated). The only “hackish” thing about it is that formally
According toSphinx documentation, there is “Phase 1: Reading”, when the doctree is prepared and cached on the disk (to
The visual appearance is entirely controlled by the selected Sphinx theme (through CSS). Matplotlib docs use |
@story645 thanks for pinging. However, I don’t feel competent to review this topic and I don’t have the time to dig into this. |
Looks like this needs a rebase now. |
MikhailRyazanov commentedNov 20, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks@MikhailRyazanov! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again. |
Thanks@QuLogic! Will it be released in 3.7.0 or 3.6.3? (And when this can be expected?) |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
This PR solves multiple problems with file handling in
matplotlib.sphinxext.plot_directive
described in issue#24005 (and#13858) by delegating all files copying and links generation to the Sphinx:download:
role instead of trying to do so explicitly (which apparently cannot be done properly with the current approach).PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).