Skip to content

Replace hand-rolled typings with @vscode/python-environments npm package#467

Merged
edvilme merged 1 commit intomainfrom
use-python-environments-npm
Mar 10, 2026
Merged

Replace hand-rolled typings with @vscode/python-environments npm package#467
edvilme merged 1 commit intomainfrom
use-python-environments-npm

Conversation

@edvilme
Copy link
Copy Markdown
Contributor

@edvilme edvilme commented Mar 10, 2026

Summary

Replace the manual \src/typings/pythonEnvironments.d.ts\ type declarations and \�xtensions.getExtension()\ activation pattern with the official @vscode/python-environments\ npm package.

Changes

  • Added @vscode/python-environments: ^1.0.0\ dependency
  • Added scoped registry to .npmrc\ for the Azure DevOps feed
  • Replaced \getEnvironmentsExtensionAPI()\ to use \PythonEnvironments.api()\ instead of manual extension activation
  • Removed \�xtensions\ import from vscode (no longer needed)
  • Deleted hand-rolled \src/typings/pythonEnvironments.d.ts\

Fixes #466

@edvilme edvilme added the debt Technical debt or repo cleanup label Mar 10, 2026
@edvilme edvilme enabled auto-merge (squash) March 10, 2026 03:11
Copy link
Copy Markdown

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@edvilme edvilme merged commit c50f485 into main Mar 10, 2026
21 of 22 checks passed
@edvilme edvilme deleted the use-python-environments-npm branch March 10, 2026 16:21
edvilme added a commit that referenced this pull request Apr 1, 2026
edvilme added a commit that referenced this pull request Apr 7, 2026
* test: add coverage for nearestConfig with .mypy.ini, pyproject.toml, setup.cfg (refs #496, relates to #357)

Co-authored-by: Copilot <[email protected]>

* test: add coverage for global settings defaults including ignorePatterns and daemonStatusFile (refs #496, relates to #325, #347)

Co-authored-by: Copilot <[email protected]>

* test: add coverage for daemonStatusFile in _get_dmypy_args (refs #496, relates to #347)

Co-authored-by: Copilot <[email protected]>

* test: add coverage for daemonStatusFile in TS settings and checkIfConfigurationChanged (refs #496, relates to #347)

Co-authored-by: Copilot <[email protected]>

* test: add coverage for PythonEnvironments.api() interpreter resolution (refs #496, relates to #467)

Co-authored-by: Copilot <[email protected]>

* style: fix prettier formatting in settings.unit.test.ts

* fix: address review comments - add missing mock attrs, try/finally cleanup

- Add normalize_path to mock_lsp_utils in test_global_defaults.py
- Add fallback guard ensuring normalize_path is set even if lsp_utils
  was mocked by another test file first
- Wrap dmypy status file test bodies in try/finally so _clear_dmypy_cache()
  runs even when assertions fail

Co-authored-by: Copilot <[email protected]>

* fix: address review comments — unused imports, assertion, const

- Remove unused imports (PythonEnvironmentApi, commands, Disposable, Event)
- Add explicit envsApiStub.calledOnce assertion in fallback test
- Change let workspace1 to const (2 occurrences)

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Technical debt or repo cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template Sync: Use @vscode/python-environment

2 participants