Skip to content
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

Make extension management quiet #6567

Merged
merged 8 commits into from Jun 15, 2019
Merged

Make extension management quiet #6567

merged 8 commits into from Jun 15, 2019

Conversation

@vidartf
Copy link
Member

@vidartf vidartf commented Jun 13, 2019

References

Fixes #5986.
Fixes #6499.

Code changes

Main points:

  • install/uninstall/build commands will now only show a spinner by default
  • any failing subprocesses will log its output to error
  • use --debug to track which commands are being executed, and see their output after command completion
  • adds a file-backed log handler for certain entry points (build and ext install/uninstall). Deleted upon successful completion.

User-facing changes

jupyter labextension install/uninstall and jupyter lab build will all be mostly quiet by default, but have spinner while processing:

image

Backwards-incompatible changes

None (only internal functions change signature).

Main points:
- install/uninstall/build commands will now only show a spinner by default
- any failing subprocesses will log its output to error
- use `--debug` to track which commands are being executed, and see their output after command completion
@jupyterlab-dev-mode
Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Jun 13, 2019

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

jupyterlab/commands.py Outdated Show resolved Hide resolved
@vidartf
Copy link
Member Author

@vidartf vidartf commented Jun 14, 2019

I've now added code to use a file-backed debug log handler.

@vidartf vidartf requested a review from blink1073 Jun 14, 2019
jupyterlab/debuglog.py Outdated Show resolved Hide resolved
jupyterlab/labapp.py Show resolved Hide resolved
def debug_logging(self):
log_path = self.debug_log_path
if not log_path:
handle, log_path = tempfile.mkstemp(prefix='jupyterlab-log-', suffix='.log')
Copy link
Member

@blink1073 blink1073 Jun 14, 2019

Why not create a jupyterlab-debug file in the cwd by default, same as npm?

Copy link
Member Author

@vidartf vidartf Jun 14, 2019

I think npm puts it in its config dir now. I always considered getting the log files in cwd a nuisance. Having the tmp / auto-name also ensure that we can have multiple commands running at the same time, and you will avoid permission issues and races on multi-user systems. It also ensures some level of automatic cleanup.

Copy link
Member Author

@vidartf vidartf Jun 14, 2019

Clarification, npm puts it in its cache dir (npm config get cache).

@vidartf
Copy link
Member Author

@vidartf vidartf commented Jun 14, 2019

I assume the test failure is relevant. Any idea how to fix?

AttributeError: type object 'DebugLogFileMixin' has no attribute 'class_get_trait_help'

@vidartf
Copy link
Member Author

@vidartf vidartf commented Jun 14, 2019

I figured it out ✔️

Copy link
Member

@blink1073 blink1073 left a comment

LGTM, thanks!

jupyterlab/commands.py Outdated Show resolved Hide resolved
@jasongrout jasongrout added this to the 1.0 milestone Jun 15, 2019
@blink1073
Copy link
Member

@blink1073 blink1073 commented Jun 15, 2019

Failure is unrelated. Thanks!

@blink1073 blink1073 merged commit 79e0399 into jupyterlab:master Jun 15, 2019
7 of 9 checks passed
@vidartf vidartf deleted the quiet branch Jun 15, 2019
@lock
Copy link

@lock lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants