-
Notifications
You must be signed in to change notification settings - Fork 30
Set lower default verbosity and add config options. #150
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -545,7 +545,13 @@ def jupyterlite_build(app: Sphinx, error): | |
| print("[jupyterlite-sphinx] Running JupyterLite build") | ||
| jupyterlite_config = app.env.config.jupyterlite_config | ||
| jupyterlite_contents = app.env.config.jupyterlite_contents | ||
| jupyterlite_dir = app.env.config.jupyterlite_dir | ||
|
|
||
| jupyterlite_dir = str(app.env.config.jupyterlite_dir) | ||
|
|
||
| jupyterlite_debug = app.env.config.jupyterlite_debug | ||
| jupyterlite_log_level = app.env.config.jupyterlite_log_level | ||
| jupyterlite_verbosity = app.env.config.jupyterlite_verbosity | ||
| jupyterlite_reporter = app.env.config.jupyterlite_reporter | ||
|
|
||
| config = [] | ||
| if jupyterlite_config: | ||
|
|
@@ -574,21 +580,36 @@ def jupyterlite_build(app: Sphinx, error): | |
| apps_option.extend(["--apps", "voici"]) | ||
|
|
||
| command = [ | ||
| "jupyter", | ||
| "lite", | ||
| "build", | ||
| "--debug", | ||
| *config, | ||
| *contents, | ||
| "--contents", | ||
| os.path.join(app.srcdir, CONTENT_DIR), | ||
| "--output-dir", | ||
| os.path.join(app.outdir, JUPYTERLITE_DIR), | ||
| *apps_option, | ||
| "--lite-dir", | ||
| jupyterlite_dir, | ||
| c | ||
| for c in ( | ||
| "jupyter", | ||
| "lite", | ||
| "doit" "build", | ||
| "--debug" if jupyterlite_debug else None, | ||
| *config, | ||
| *contents, | ||
| "--contents", | ||
| os.path.join(app.srcdir, CONTENT_DIR), | ||
| "--output-dir", | ||
| os.path.join(app.outdir, JUPYTERLITE_DIR), | ||
| *apps_option, | ||
| "--lite-dir", | ||
| jupyterlite_dir, | ||
| "--log-level" if jupyterlite_log_level is not None else None, | ||
| jupyterlite_log_level, | ||
| "--", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c.f. PR #152
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's needed to pass the args to |
||
| "--verbosity" if jupyterlite_verbosity else None, | ||
| jupyterlite_verbosity, | ||
| "--reporter" if jupyterlite_reporter else None, | ||
| jupyterlite_reporter, | ||
| ) | ||
| if c is not None | ||
| ] | ||
|
|
||
| assert all( | ||
| [isinstance(s, str) for s in command] | ||
| ), f"Expected all commands arguments to be a str, got {command}" | ||
|
|
||
| subprocess.run(command, cwd=app.srcdir, check=True) | ||
|
|
||
| print("[jupyterlite-sphinx] JupyterLite build done") | ||
|
|
@@ -611,10 +632,16 @@ def setup(app): | |
|
|
||
| # Config options | ||
| app.add_config_value("jupyterlite_config", None, rebuild="html") | ||
| app.add_config_value("jupyterlite_dir", app.srcdir, rebuild="html") | ||
| app.add_config_value("jupyterlite_dir", str(app.srcdir), rebuild="html") | ||
| app.add_config_value("jupyterlite_contents", None, rebuild="html") | ||
| app.add_config_value("jupyterlite_bind_ipynb_suffix", True, rebuild="html") | ||
|
|
||
| # JLite debug configuration options | ||
| app.add_config_value("jupyterlite_debug", False, rebuild="html") | ||
| app.add_config_value("jupyterlite_log_level", "WARN", rebuild="html") | ||
| app.add_config_value("jupyterlite_verbosity", "0", rebuild="html") | ||
| app.add_config_value("jupyterlite_reporter", "zero", rebuild="html") | ||
|
|
||
| app.add_config_value("global_enable_try_examples", default=False, rebuild=True) | ||
| app.add_config_value("try_examples_global_theme", default=None, rebuild=True) | ||
| app.add_config_value("try_examples_global_warning_text", default=None, rebuild=True) | ||
|
|
||
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.
@Carreau I think you missed a comma here(?).
I don't have time now, but I will try to debug this more tonight US time.