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

Check jupyter frontend widget availability before setting env to lab #216

Closed
wants to merge 3 commits into from

Conversation

Koncopd
Copy link
Member

@Koncopd Koncopd commented Aug 7, 2022

#214

Unfortunately it doesn't work. About half of times it reports failure to access JupyterFrontEnd, despite it working later when it is actually needed and called.

On the other hand, trying to take into account the async nature and calling app.ready() (see this) coroutine and blocking the code execution before getting the result leads to infinite waiting times.

@Koncopd Koncopd marked this pull request as draft August 7, 2022 10:58
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

@github-actions github-actions bot temporarily deployed to pull request August 7, 2022 11:00 Inactive
@codecov
Copy link

codecov bot commented Aug 7, 2022

Codecov Report

Merging #216 (be401de) into main (27f35e0) will decrease coverage by 0.44%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
- Coverage   88.20%   87.76%   -0.45%     
==========================================
  Files          20       20              
  Lines         882      891       +9     
==========================================
+ Hits          778      782       +4     
- Misses        104      109       +5     
Impacted Files Coverage Δ
nbproject/dev/_jupyter_lab_commands.py 37.50% <25.00%> (-4.17%) ⬇️
nbproject/_header.py 87.83% <66.66%> (-1.06%) ⬇️
nbproject/_meta.py 94.54% <66.66%> (-1.61%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@Koncopd
Copy link
Member Author

Koncopd commented Aug 7, 2022

By doing async i mean:

@run_sync # util to turn async into sync from nbclient
async def _check_frontend():
    global app
    if app is None:
        app = JupyterFrontEnd()

    await app.ready()

    return app.version != ""

and then using it in the header results in infinite waiting time sometimes. Obviously not applicable for us here.

@Koncopd
Copy link
Member Author

Koncopd commented Aug 7, 2022

This PR is just for the discussion on Monday.

@falexwolf
Copy link
Member

Understood! Thank you for trying it!

@Koncopd Koncopd closed this Aug 16, 2022
@falexwolf falexwolf deleted the ipylab_check branch April 16, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants