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

Leverage new Python API to pass python.exe path for notebook to Pylance #9842

Merged
merged 33 commits into from
May 17, 2022

Conversation

debonte
Copy link
Contributor

@debonte debonte commented Apr 29, 2022

Contributes to https://github.com/microsoft/pyrx/issues/2343

When Pylance's LSP notebooks experiment is enabled, the Python extension will be responsible for starting Pylance and therefore also needs to be able to provide the python.exe path. This change leverages a new Python API called registerJupyterPythonPathFunction to hook into Pylance's config setting requests and provide the python.exe path for a notebook's kernel.

Jupyter's default behavior is unchanged. It only uses the new behavior when the experiment is enabled via the python.pylanceLspNotebooksEnabled setting.

The related Pylance changes are in this PR: https://github.com/microsoft/pyrx/pull/2382
The related Python changes will be coming soon. They are currently blocked on upgrading Python's LSP version.

@rchiodo
Happy to add unit tests if you think they would be valuable.
I didn't see any mention of Pylance in the test plan, so I didn't make any changes there.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

@debonte debonte requested a review from a team as a code owner April 29, 2022 17:19
@ghost
Copy link

ghost commented Apr 29, 2022

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ debonte sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

package-lock.json Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2022

Codecov Report

Merging #9842 (1c85c7d) into main (730cb6f) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##            main   #9842   +/-   ##
=====================================
  Coverage     63%     63%           
=====================================
  Files        216     216           
  Lines      10133   10135    +2     
  Branches    1614    1614           
=====================================
+ Hits        6480    6484    +4     
+ Misses      3134    3133    -1     
+ Partials     519     518    -1     
Impacted Files Coverage Δ
src/platform/api/types.ts 100% <ø> (ø)
src/platform/common/types.ts 100% <ø> (ø)
src/platform/common/configSettings.ts 83% <100%> (+<1%) ⬆️
src/platform/errors/errorHandler.ts 63% <0%> (+<1%) ⬆️

@debonte
Copy link
Contributor Author

debonte commented May 17, 2022

Test failure is due to #10046

@debonte debonte merged commit 9d9ad7d into microsoft:main May 17, 2022
@debonte debonte deleted the lspNotebooks branch May 17, 2022 21:55
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.

3 participants