Closed CBroz1 closed 1 year ago
As a temporary fix, I plan to add a timeout to my subprocess.run
call.
Hi.
When you run mkdocs
, that's just a wrapper for python -m mkdocs
. There's only one process involved - that's Python.
So there's nothing weird about processes here.
But I think the part that's missing from the other setup is that in one case you have a real terminal backing the process, and in the other case it's a piped output.
To also get that effect, instead of mkdocs build
you could run mkdocs build | cat
or some other way to remove the terminal.
As a separate comment, mkdocs-gen-files
is not a solution intended for just adding custom Python code into a mkdocs build
. You should be using mkdocs_gen_files.open
at least once, otherwise its functionality remains almost entirely unused. import mkdocs_gen_files
could be dropped from your script with no difference.
Instead, just use MkDocs' hooks:
config in a similar way: https://www.mkdocs.org/user-guide/configuration/#hooks
-then you'll just need to wrap your main code into def on_config(config):
I closed the issue but we can still continue to discuss if something is unclear
Thanks for your insights @oprypin! I'll try piping to cat
to see what I find. Sorry for the miscommunication - I oversimplified above. Our full script does run mkdocs_gen_files.open
after the snippet I posted above.
In short, I'm looking for the command that triggers the
make_pages.py
to improve my error handling when building with docker.For context, I'm using the
make_pages.py
script togit clone
multiple repos when I build the docs. I'm using the structure below, which works for repos that exist, and correctly fails for repos that don't exist, but can't handle private repos. I'd like to keep some repos private until I'm ready to publish, and just rebuild at that time.If the repo doesn't exist, my
except
works well. If it's private, however, I see the following in my docker consoleI'm trying to track down the parent process to replicate the error better except the error type. If I try launching
make_pages
from a python terminal, it prompts me to enter in credentials.