profile
viewpoint
Tyreke White Anapo14 @Microsoft Seattle, WA Program Manager for Python Developer Tools in Visual Studio and VS Code.

Anapo14/CosineWave 0

This is a test file.

Anapo14/gams-matlab 0

Helper functions for coupling GAMS optimisation models with MATLAB for data I/O

Anapo14/Japan-Digital-Archive 0

Digital Archive of Japan's 2011 Disasters

Anapo14/ptvsd 0

Python debugger package for use with Visual Studio and Visual Studio Code.

Anapo14/python-language-server 0

Microsoft Language Server for Python

Anapo14/python-sample-tweeterapp 0

Sample Django+React+Postgres application for use in Visual Studio Code and Azure

Anapo14/python-sample-vscode-flask-tutorial 0

Sample code for the Flask tutorial in the VS Code documentation

push eventmicrosoft/vscode-python

Joyce Er

commit sha b129412d168ffc29e5dd8f7e72bc30cdf32f14e9

Show prompt, code action and lens for tensorboardX (#15210)

view details

push time in 3 hours

PR merged microsoft/vscode-python

Reviewers
Show prompt, code action and lens for tensorboardX skip news

New requirement from @jmew: tensorboardX is a package used for creating tf event files during runs e.g. from tensorboardX import SummaryWriter. Show all of our existing import detection entrypoints for tensorboardX as well as tensorboard.

Note that we will still install tensorboard and not tensorboardX for the user to launch an integrated TensorBoard session, as even with tensorboardX installed users will still require tensorboard to visualize their log data.

+55 -42

1 comment

4 changed files

joyceerhl

pr closed time in 3 hours

Pull request review commentmicrosoft/vscode-python

Show prompt, code action and lens for tensorboardX

 suite('TensorBoard code action provider', () => {             'Failed to provide code action for Python file containing tensorboard import',         );     });-    test('Provides code action for Python ipynbs', () => {+    test('Provides code action for tensorboardX in Python files', () => {+        // eslint-disable-next-line @typescript-eslint/no-unused-vars+        const document = new MockDocument('import foo\nimport tensorboardX', 'foo.py', async (_doc) => true);+        selection = TypeMoq.Mock.ofType<Selection>();+        selection.setup((s) => s.active).returns(() => new Position(1, 0));+        const codeActions = codeActionProvider.provideCodeActions(document, selection.object);+        assert.ok(+            codeActions.length > 0,+            'Failed to provide code action for Python file containing tensorboard import',

I don't think this is needed. But for all these test files you could make a base function take the import name. Then just call that function with either tensorboard or tensorboardX as parameters. Less code and keeps from having copy paste issues (like on this line it says tensorboard instead of tensorboardX). But not required.

joyceerhl

comment created time in 4 hours

pull request commentmicrosoft/vscode-python

Show prompt, code action and lens for tensorboardX

Codecov Report

Merging #15210 (84cd2be) into main (2019e7d) will decrease coverage by 0%. The diff coverage is 66%.

@@          Coverage Diff           @@
##            main   #15210   +/-   ##
======================================
- Coverage     65%      65%   -1%     
======================================
  Files        559      559           
  Lines      26600    26601    +1     
  Branches    3839     3840    +1     
======================================
  Hits       17315    17315           
  Misses      8581     8581           
- Partials     704      705    +1     
Impacted Files Coverage Δ
src/client/tensorBoard/helpers.ts 73% <66%> (-4%) :arrow_down:
joyceerhl

comment created time in 4 hours

PR opened microsoft/vscode-python

Show prompt, code action and lens for tensorboardX skip news

New requirement from @jmew: tensorboardX is a package used for creating tf event files during runs e.g. from tensorboardX import SummaryWriter. Show all of our existing import detection entrypoints for tensorboardX as well as tensorboard.

Note that we will still install tensorboard and not tensorboardX for the user to launch an integrated TensorBoard session, as even with tensorboardX installed users will still require tensorboard to visualize their log data.

+50 -6

0 comment

4 changed files

pr created time in 4 hours

push eventmicrosoft/vscode-python

Shahzaib Paracha

commit sha 5ac69475bb7b654303c3ccf60f76348cc4583250

Fix command for debug test config (#14863) * Chenged the test command to reflect the error we have already * added thank you message

view details

push time in 5 hours

PR merged microsoft/vscode-python

Fix command for debug test config

For #14729 Changed the command suggested when attempting to use "debug tests" configuration to what is inline with the files we have

<!-- If an item below does not apply to you, then go ahead and check it off as "done" and strikethrough the text, e.g.: - [x] ~Has unit tests & system/integration tests~ -->

  • [ ] 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.
  • [x ] ~Has sufficient logging.~
  • [x ] ~Has telemetry for enhancements.~
  • [x ] ~Unit tests & system/integration tests are added/updated.~
  • [x ] ~Test plan is updated as appropriate.~
  • [x ] ~package-lock.json has been regenerated by running npm install (if dependencies have changed).~
  • [x] ~The wiki is updated with any design decisions/details.~
+3 -1

2 comments

2 changed files

ShahzaibParacha

pr closed time in 5 hours

push eventmicrosoft/vscode-python

Karthik Nadig

commit sha 2019e7da524e2a09390ddeda51324c42ec41f4d2

Remove fallback for python path updater service. (#15205) * Remove fallback for python path updater service. * Remove outdated comment

view details

push time in 5 hours

PR merged microsoft/vscode-python

Reviewers
Remove fallback for python path updater service. skip news skip tests
+14 -19

0 comment

1 changed file

karthiknadig

pr closed time in 5 hours

pull request commentmicrosoft/vscode-python

Remove fallback from the progressDisplay.ts

Codecov Report

Merging #15206 (eeac46e) into main (d58b57b) will decrease coverage by 0%. The diff coverage is 62%.

@@          Coverage Diff           @@
##            main   #15206   +/-   ##
======================================
- Coverage     65%      65%   -1%     
======================================
  Files        561      559    -2     
  Lines      26607    26602    -5     
  Branches    3828     3839   +11     
======================================
- Hits       17328    17317   -11     
- Misses      8572     8579    +7     
+ Partials     707      706    -1     
Impacted Files Coverage Δ
src/client/interpreter/display/progressDisplay.ts 83% <62%> (-4%) :arrow_down:
src/client/common/process/pythonEnvironment.ts 81% <0%> (-9%) :arrow_down:
src/client/common/installer/productInstaller.ts 40% <0%> (-4%) :arrow_down:
...rc/client/common/process/pythonExecutionFactory.ts 87% <0%> (-2%) :arrow_down:
src/client/interpreter/interpreterService.ts 60% <0%> (-1%) :arrow_down:
src/client/common/types.ts 100% <0%> (ø)
src/client/activation/types.ts 100% <0%> (ø)
src/client/common/process/types.ts 100% <0%> (ø)
src/client/common/installer/types.ts 100% <0%> (ø)
src/client/common/installer/condaInstaller.ts 100% <0%> (ø)
... and 8 more
karthiknadig

comment created time in 5 hours

Pull request review commentmicrosoft/vscode-python

Remove fallback for python path updater service.

 export class PythonPathUpdaterService implements IPythonPathUpdaterServiceManage         if (!failed && pythonPath) {             // Ask for info using the new discovery code first.             // If it returns undefined, fallback on the old code.
karthiknadig

comment created time in 6 hours

push eventmicrosoft/vscode-python

Karthik Nadig

commit sha 5a7b6ee6757a24eadf623061da77320788df21b5

Remove fallback from interpreterService.ts (#15203)

view details

push time in 6 hours

PR merged microsoft/vscode-python

Reviewers
Remove fallback from interpreterService.ts skip news
+33 -30

1 comment

2 changed files

karthiknadig

pr closed time in 6 hours

push eventmicrosoft/vscode-python

Karthik Nadig

commit sha b6853e27a6aec1070ca6133f42e704404a846769

Remove fallback from helpers.ts (#15201)

view details

push time in 6 hours

PR merged microsoft/vscode-python

Reviewers
Remove fallback from helpers.ts skip news
+12 -8

0 comment

2 changed files

karthiknadig

pr closed time in 6 hours

issue openedmicrosoft/vscode-python

Broken default snippets

<!-- Please search existing issues to avoid creating duplicates. -->

Environment data

  • VS Code version: 1.52.1
  • Extension version: v2021.1.502429796
  • OS and version: win10 1909
  • Python version: 3.8.2
  • Type of virtual environment used: virtualenv
  • Relevant/affected Python packages and their versions: none
  • Relevant/affected Python-related VS Code extensions and their versions: none
  • Value of the python.languageServer setting: Jedi

Expected behaviour

When try, for, if etc is typed snippet suggestions appears in popup

Actual behaviour

No default snippets suggestions available, while user-defined snippets seems to work fine

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Type try
  2. Press Ctrl + Space
  3. No try/except/else/finally and other useful suggestions

<!-- Note: If you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ . -->

Logs

<details>

<summary>Output for <code>Python</code> in the <code>Output</code> panel (<code>View</code>→<code>Output</code>, change the drop-down the upper-right of the <code>Output</code> panel to <code>Python</code>) </summary>

<p>

Error 2021-01-23 01:59:11: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:592: DeprecationWarning: Providing the line is now done in the functions themselves like `Script(...).complete(line, column)`
  script = jedi.Script(
c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:592: DeprecationWarning: Providing the column is now done in the functions themselves like `Script(...).complete(line, column)`
  script = jedi.Script(

Error 2021-01-23 01:59:11: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:592: DeprecationWarning: Use the code keyword argument instead.
  script = jedi.Script(
c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:592: DeprecationWarning: Deprecated since version 0.17.0. Use the project API instead, which means Script(project=Project(dir, sys_path=sys_path)) instead.
  script = jedi.Script(

Error 2021-01-23 01:59:11: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:105: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_signatures instead.
  call_signatures = script.call_signatures()

Error 2021-01-23 01:59:11: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:230: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).complete instead.
  completions = script.completions()

Error 2021-01-23 01:59:11: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:626: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).infer instead.
  script.goto_definitions(), request["id"]

Error 2021-01-23 01:59:15: stderr jediProxy Error (stderr) c:\VSCode\data\extensions\ms-python.python-2021.1.502429796\pythonFiles\completion.py:584: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
  jedi.api.names(

</p> </details>

created time in 6 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class PyenvLocator extends FSWatchingLocator {     // eslint-disable-next-line class-methods-use-this     public async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.Pyenv] : uniq([PythonEnvSource.Pyenv].concat(env.source));

If we take Source as where a environment can be found, I guess your reasoning makes sense.

Auto-selector should get a list of found environments, and it should pick one from that list based purely on that list.

The selection process does better when Source info is provided to them. So even if we're providing a list, source information is still useful. But that's something we can discuss later.

karthiknadig

comment created time in 6 hours

PR opened microsoft/vscode-python

Support moving/adding/deleting cells in notebook intellisense skip news

The concat of a notebook into a single python file works fine if the user edits cells. However when adding new cells, no changes were being made to the file. Nor when deleting or moving cells.

This change introduces change events when deleting/adding/moving cells as if the user typed the new cells out.

+225 -3

0 comment

5 changed files

pr created time in 6 hours

push eventmicrosoft/vscode-python

Jake Bailey

commit sha f63c2a2f084b5503dd4961066f97197d4a7566ec

Remove old blob download code for Pylance (#15190)

view details

push time in 6 hours

PR merged microsoft/vscode-python

Remove old blob download code for Pylance skip news

This all is the old code that handled Pylance when it was being dogfooded. It's dead code now, and occasionally we get people who still have the old settings and are surprised when Pylance doesn't start up.

+21 -232

0 comment

6 changed files

jakebailey

pr closed time in 6 hours

Pull request review commentmicrosoft/vscode-python

Remove fallback for python path updater service.

 export class PythonPathUpdaterService implements IPythonPathUpdaterServiceManage         if (!failed && pythonPath) {             // Ask for info using the new discovery code first.             // If it returns undefined, fallback on the old code.

Comment needs updating as well.

karthiknadig

comment created time in 6 hours

issue closedmicrosoft/vscode-python

Provide terminal service for extensions built on top of Python extension

Hi, I searched the Internet and the issues, but could not find anything related to how to use vscode-python as a base for my own VS code extension.

Namely, I'd like to create a VS extension for icontract-hypothesis and run the module in a terminal.

Please correct me if I am wrong: I can not just create a terminal, as there is no way to wait till the command is executed and I would need to re-implement something like https://github.com/microsoft/vscode-python/blob/411d1d4ae7e3884a8ef9294a0aa1688dc05d0f37/src/client/common/terminal/syncTerminalService.ts#L90.

Is it somehow possible to use terminal service from vscode-python in my own extension? If so, could you maybe point me to the documentation or a short example?

closed time in 7 hours

mristin

issue commentmicrosoft/vscode-python

Provide terminal service for extensions built on top of Python extension

@karthiknadig thanks for the clarification!

One hack that worked for me is to start a new terminal, wait for change and then send the text. I'll just close the terminal and re-open the new one on every execution.

mristin

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class WindowsStoreLocator extends FSWatchingLocator {      protected async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.PathEnvVar] : [PythonEnvSource.PathEnvVar, ...env.source];

But if it's always available on PATH, why do we even have this locator?🤔

karthiknadig

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class WindowsStoreLocator extends FSWatchingLocator {      protected async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.PathEnvVar] : [PythonEnvSource.PathEnvVar, ...env.source];

Windows store python is always available via PATH. That is kind of a requirement. I will update the windows path locator.

karthiknadig

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class WindowsStoreLocator extends FSWatchingLocator {      protected async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.PathEnvVar] : [PythonEnvSource.PathEnvVar, ...env.source];

Also, we should also edit the actual windows path locator in this PR.

karthiknadig

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class WindowsStoreLocator extends FSWatchingLocator {      protected async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.PathEnvVar] : [PythonEnvSource.PathEnvVar, ...env.source];

It's not discovered or guaranteed to be on PATH tho. There's this WINDOWSAPPS env variable using which it's found.

karthiknadig

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class PyenvLocator extends FSWatchingLocator {     // eslint-disable-next-line class-methods-use-this     public async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.Pyenv] : uniq([PythonEnvSource.Pyenv].concat(env.source));

The other thing is, we need to get rid of the source eventually. Auto-selector should get a list of found environments, and it should pick one from that list based purely on that list. This is added as a bridge between the two until we get rid of it. I have added a task for this.

karthiknadig

comment created time in 7 hours

pull request commentmicrosoft/vscode-python

Remove fallback from virtual environment prompt

Codecov Report

Merging #15207 (e927c98) into main (d58b57b) will decrease coverage by 0%. The diff coverage is 0%.

@@          Coverage Diff           @@
##            main   #15207   +/-   ##
======================================
- Coverage     65%      65%   -1%     
======================================
  Files        561      561           
  Lines      26607    26608    +1     
  Branches    3828     3829    +1     
======================================
  Hits       17328    17328           
- Misses      8572     8573    +1     
  Partials     707      707           
Impacted Files Coverage Δ
...client/interpreter/virtualEnvs/virtualEnvPrompt.ts 78% <0%> (-2%) :arrow_down:
karthiknadig

comment created time in 7 hours

Pull request review commentmicrosoft/vscode-python

Add source field to environment info

 export class PyenvLocator extends FSWatchingLocator {     // eslint-disable-next-line class-methods-use-this     public async doResolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {         const executablePath = typeof env === 'string' ? env : env.executable.filename;+        const source =+            typeof env === 'string' ? [PythonEnvSource.Pyenv] : uniq([PythonEnvSource.Pyenv].concat(env.source));

My view is that, if the resolver identifies an environment as a one that it could have discovered. Then it should set the source.

karthiknadig

comment created time in 7 hours

more