-
-
Notifications
You must be signed in to change notification settings - Fork 674
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run sphinx-autobuild
via tox -e docs-live[-src]
#2400
Conversation
0959f55
to
48afd06
Compare
Do the docs use docstrings from elsewhere than |
Oh hell yes. One further idea / request: it looks like there's also an |
In my usage so far, this seems confusingly inconsistent. It always registers a file save in the console, but sometimes the changes are updated in the browser and sometimes they aren't. I haven't yet been able to determine a rhyme or reason to it. |
No - the public docs should only be dependent on the toga-core package.
That seems like reasonable thing to turn on. Alternatively (or as well), you could configure the tox target so that it allows passthrough of command line arguments (see how the |
After experimenting with So, I'm inclined to leave the eccentricities of I also added |
Scratch the random port; it's too annoying if you restart autobuild and expect the previous browser tab you were using to work again. As for the inconsistencies you noted, @HalfWhitt, I've been seeing some bizarre things as well. Lacking intimate knowledge of how Sphinx works....my assumption is the reuse of the |
b3be34a
to
da3e0d8
Compare
tox.ini
Outdated
[docs] | ||
build_dir = _build | ||
# -W: make warnings into errors | ||
# --keep-going: continue on errors | ||
# -j: run with multiple processes | ||
sphinx_args = -W --keep-going -j auto | ||
# -v: verbose logging | ||
# -E: force rebuild of environment | ||
# -T: print traceback on error | ||
# -a: read/parse all files | ||
# -d: use tox's temp dir for caching | ||
sphinx_args_extra = {[docs]sphinx_args} -v -E -T -a -d {envtmpdir}/doctrees | ||
# replace when Sphinx 7.3 is released: | ||
# -T -> --show-traceback | ||
# -W -> --fail-on-warning | ||
# -b -> --builder | ||
# -v -> --verbose | ||
# -a -> --write-all | ||
# -E -> --fresh-env | ||
sphinx_args = -T -W --keep-going --jobs auto |
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.
I decided to re-work all of this from my original implementation.
Using -E
, -a
, and -d {envtmpdir}/doctrees
all the time makes all of this really slow since Sphinx basically needs to start from scratch every time. In your local environment, though, using all the caching really speeds things up. Use tox -e docs -- -aE
if you want to start from scratch locally; tox -e docs-all
will continue always re-reading everything, though.
Using -v
in a terminal creates a worse experience since it needlessly lists all the files being read instead of using the screen redrawing to list the files being processed.
da3e0d8
to
5d1ac88
Compare
I wonder if the inconsistent loading has anything to do with the fact that tox doesn't seem to be installing core as editable; that's probably why deleting the relevant environment folder in .tox always updates docstrings, since the packages are all reinstalled from their current state. EDIT: Eh, never mind. Changing that doesn't seem to make it any more reliable. |
Actually, that's a good point; I think all my testing of seeing edits in the "live view" was while running the command without That's why the usual recommendation for updating API docstrings in your local build was to run At any rate, I'll have it install an editable version....that should be fine since its essentially what's happening when I run sphinx directly in the command line. |
As for other inconsistencies, some examples may help since using a different build directory seemed to make everything a lot better for me. |
5d1ac88
to
c339e1f
Compare
I also realized the |
c339e1f
to
dc65105
Compare
FYI; beware of using |
dc65105
to
01c0b70
Compare
f7cdadd
to
0c1621c
Compare
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.
Huge +1 on this. I've added a reference to the contribution guide so that everyone knows this exists.
Thank you so much for implementing this rmartin16, you rock! The merged version is working beautifully. |
Changes
sphinx-autobuild
fromtox
tox -e docs-live
will incrementally build any detected changes within thedocs
directorytox -e docs-live-src
will include rebuilding for changes to docstrings in the source that are compiled in to the documentation....but this requires a full rebuild of the docs for any changes since Sphinx doesn't have a mapping of source files to docs files.PR Checklist: