Skip to content

[pull] main from microsoft:main #6

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

Open
wants to merge 2,560 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2560 commits
Select commit Hold shift + click to select a range
62897c6
Add logging for executeCommand (#24138)
anthonykim1 Sep 19, 2024
63280be
Default PYTHONSTARTUP to opt out/off for Stable Release (#24140)
anthonykim1 Sep 19, 2024
f9bb1f1
Use new REPL notebook API (#24029)
amunger Sep 20, 2024
336a110
add experimental tag for enableShellIntegration (#24144)
anthonykim1 Sep 20, 2024
af2aa6e
Remove variableProvider suite.only from limiting other tests (#24146)
anthonykim1 Sep 21, 2024
f8b861a
Change PYTHONSTARTUP setting name to Python.terminal.shell integratio…
anthonykim1 Sep 23, 2024
8cfd2d0
Bump importlib-metadata from 8.4.0 to 8.5.0 (#24100)
dependabot[bot] Sep 23, 2024
c314bab
Fix issue with creating `.gitignore` with venvs (#24155)
karthiknadig Sep 23, 2024
f7e0857
Remove redundant @typescript-eslint/no-explicit-any suppression (#24091)
vishrutss Sep 23, 2024
06a976f
Tests for PYTHONSTARTUP setting (#24145)
anthonykim1 Sep 23, 2024
14e134e
Add separate enum for telemetry when running python manually. (#24157)
karthiknadig Sep 23, 2024
d879a0d
Adjust PythonStartUp test for new setting value (#24165)
anthonykim1 Sep 24, 2024
dd76d4f
Change log level on pixi interpreter discovery to reduce confusion (…
anthonykim1 Sep 24, 2024
30b7884
Fix) Python Shell Integration setting should have markdown descriptio…
anthonykim1 Sep 25, 2024
710d3c8
Remove branch coverage and refactor coverage.py methods for accessing…
eleanorjboyd Sep 25, 2024
9f6735e
Prioritize `conda` handler over `pixi` handler (#24198)
karthiknadig Sep 26, 2024
60bd545
Update version for 2024.16.0 release (#24212)
karthiknadig Sep 30, 2024
23424cb
Update version for pre-release (#24213)
karthiknadig Sep 30, 2024
8bcf046
Remove unnecessary file read on execution (#24196)
karthiknadig Oct 1, 2024
7d01dc2
Use latest build of `pet` from `main` for pre-release (#24223)
karthiknadig Oct 2, 2024
3e7d8e1
support setting only `--cov-report` arg (#24225)
eleanorjboyd Oct 2, 2024
d072503
Avoid prefixing with home when unnecessary (#24230)
DonJayamanne Oct 3, 2024
4b37abd
prevent test.only (#24235)
amunger Oct 3, 2024
c60f0dd
Bump tomli from 2.0.1 to 2.0.2 (#24229)
dependabot[bot] Oct 3, 2024
3362dc3
enable turning off the variable provider (#24231)
amunger Oct 3, 2024
92762ca
remove EOT from testing communication (#24220)
eleanorjboyd Oct 3, 2024
b8c0fc4
Update pylance.ts (#24237)
bschnurr Oct 3, 2024
1b36762
Remove notification for old linter formatter settings (#24240)
karthiknadig Oct 4, 2024
e5b47b9
Fix error with `displayName` is missing in PackageJSON (#24246)
karthiknadig Oct 4, 2024
6bd34bf
Wait 0.5 second for shell integration event, otherwise fall back to s…
anthonykim1 Oct 4, 2024
8c4dee4
Allow pytest to use correct interpreter from getActiveInterpreter (#2…
anthonykim1 Oct 4, 2024
ebe55a4
only show coverage button for rewrite (#24249)
eleanorjboyd Oct 5, 2024
204b8ca
Add customizable interpreter discovery timeout (#24227)
mnoah1 Oct 7, 2024
c2ed6b2
Update pylance gdpr classification tag (#24274)
luabud Oct 9, 2024
041be0d
Fix GDPR annotations (#24278)
lramos15 Oct 9, 2024
9be9308
fix: tag non-stable settings with new system (#24287)
rzhao271 Oct 11, 2024
c5a8e4f
Refactor code to remove unused JSDoc types (#24300)
bregwin Oct 14, 2024
5112073
Fix for conda activation during testing (#24295)
karthiknadig Oct 14, 2024
97b4610
Make `python_server.py` compatible to Python 3.7 (#24252)
T-256 Oct 14, 2024
7d471a4
Enable 3.13-dev tests
karthiknadig Oct 7, 2024
f6af3a1
Switch to `pytest`
karthiknadig Oct 7, 2024
8b4a47e
Fixes
karthiknadig Oct 7, 2024
0df1929
Fix version
karthiknadig Oct 7, 2024
e8dd8c0
Fix paths
karthiknadig Oct 8, 2024
fb79afb
Add properties to GDPR tags (#24320)
luabud Oct 17, 2024
28c13a1
Fix typo in class name (#24314)
karthiknadig Oct 18, 2024
5e5a7ce
add error message for missing pytest-cov while running coverage (#24288)
eleanorjboyd Oct 18, 2024
e7860a5
Restore `pixi` functionality only when Pixi is available (#24319)
karthiknadig Oct 21, 2024
40b29bf
Fix for duplication of python envs (#24321)
karthiknadig Oct 21, 2024
205a19e
Update VS Code engine and `@types/vscode` for APIs (#24335)
karthiknadig Oct 28, 2024
b428ba5
update jedi dependencies to add python 3.13 support (#24330)
soda92 Oct 28, 2024
d440bc1
disable shell integration for 3.13 (#24341)
anthonykim1 Oct 28, 2024
3115887
Update main version for release (#24338)
karthiknadig Oct 28, 2024
fdfe2a6
Update main to next pre-release (#24344)
karthiknadig Oct 28, 2024
9b182da
fix: upgrade settings to preview (#24354)
rzhao271 Oct 29, 2024
84e80c6
Update node version to 20.18.0 (#24356)
karthiknadig Oct 30, 2024
379229a
no longer need this proposed API (#24362)
justschen Oct 30, 2024
622653e
add python.testing.cwd to pytest discovery if present (#24384)
eleanorjboyd Nov 4, 2024
3e7e0d2
dont automatically inject PYTHONSTARTUP (#24346)
anthonykim1 Nov 4, 2024
5d56379
error msg for adapter unalignment issue (#24385)
eleanorjboyd Nov 4, 2024
b1cb5c2
dont execute history items (#24394)
amunger Nov 5, 2024
785ed68
add support for pytest describe (#24400)
eleanorjboyd Nov 8, 2024
aae2b63
add bracketed paste mode for Python3.13 and above (#24401)
anthonykim1 Nov 8, 2024
d1d125a
Switch testing communication to `fifo` on linux/mac (#24343)
eleanorjboyd Nov 8, 2024
ceabc46
Remove `debugpy` from `requirements` (#24419)
karthiknadig Nov 12, 2024
542ff38
do not use shell integration for Python subshell if Python setting is…
anthonykim1 Nov 12, 2024
7889127
Keep focus on editor when executing to native REPL (#24420)
anthonykim1 Nov 12, 2024
488401a
Fix for running `pet` only in trusted workspaces (#24429)
karthiknadig Nov 12, 2024
c9f4f15
Update version to release
karthiknadig Nov 6, 2024
654f95b
Update version for next pre-release
karthiknadig Nov 12, 2024
006dd23
Bump tomli from 2.0.2 to 2.1.0 (#24423)
dependabot[bot] Nov 12, 2024
4bc7ff7
Add needs to CI coverage check (#24421)
bregwin Nov 12, 2024
3927f66
Bump packaging from 24.1 to 24.2 (#24415)
dependabot[bot] Nov 12, 2024
3e30f9d
Ensure native finder is disposed correctly (#24432)
karthiknadig Nov 12, 2024
63cbb30
Do not use bracketed paste mode for native repl (#24433)
anthonykim1 Nov 13, 2024
85a18d4
Add failed telemetry property (#24434)
luabud Nov 13, 2024
ec67825
Set Insiders target population as VS Code Insiders for ExP (#24412)
luabud Nov 13, 2024
4c32b96
enable send to native REPL for SR users (#24440)
amunger Nov 13, 2024
dfa0520
handle NoSource exception for coverage (#24441)
eleanorjboyd Nov 14, 2024
29d4f35
fix debug restart (#24438)
eleanorjboyd Nov 14, 2024
a2b007c
disable python shell integration for wsl (#24446)
anthonykim1 Nov 15, 2024
5f0279a
Fix bad GDPR annotations (#24450)
lramos15 Nov 18, 2024
f59e31f
dont execute from outside the REPL (#24465)
amunger Nov 19, 2024
7e9b927
Remove `conda` specific telemetry (#24431)
karthiknadig Nov 19, 2024
8ac716d
Handle reloading of REPL Window (#24148)
anthonykim1 Nov 19, 2024
2fed954
Respect [tool.coverage.report] omit in coverage view (#24466)
eleanorjboyd Nov 19, 2024
98fea6e
ruff 0.8.0 fixes (#24488)
joar Nov 25, 2024
5508de4
Pin ruff to specific version (#24484)
karthiknadig Nov 25, 2024
5cec0e0
Revert "ruff 0.8.0 fixes" (#24489)
karthiknadig Nov 25, 2024
4f7165f
Add native Pixi locator (#24442)
renan-r-santos Nov 26, 2024
42b63b9
Support ruff `0.8.0` by setting ruff `target-version` to `py38` (#24492)
joar Nov 26, 2024
dba0a4c
Fix the wrong Content-Length in python-server.py for non-ascii charac…
tomoki Nov 26, 2024
3f58831
printEnvVariablesToFile.py overwrites itself if invoked without argum…
joar Nov 26, 2024
43347e7
chore: remove needsTools parameter (#24494)
rzhao271 Nov 27, 2024
eab8794
chore: register dependent pipeline for APIScan (#24496)
rzhao271 Nov 27, 2024
4153f7c
Fix: Don’t use executeCommand on python sub-shell for windows. (#24542)
anthonykim1 Dec 4, 2024
b8cc93d
add uri for unittest subtests fix "go to test" bug (#24544)
eleanorjboyd Dec 4, 2024
faf37e2
Fix) Prevent keyboard interrupt for Python3.13 REPL non-Windows (#24…
anthonykim1 Dec 9, 2024
fde203e
Revert "Fix) Prevent keyboard interrupt for Python3.13 REPL non-Windo…
karthiknadig Dec 9, 2024
10a1614
Update version for release (#24560)
karthiknadig Dec 9, 2024
0b204f8
Update `main` to next pre-release (#24563)
karthiknadig Dec 9, 2024
9f4e4f2
Remove unused files from VSIX (#24546)
karthiknadig Dec 9, 2024
b342559
Remove sourceMaps (#24561)
karthiknadig Dec 9, 2024
63c3780
Remove usage of `hash.js` (#24504)
karthiknadig Dec 9, 2024
e789348
Use env extension when available (#24564)
karthiknadig Dec 10, 2024
71a8cfc
fix typo (#24574)
musvaage Dec 10, 2024
91a74e8
remove pre-rewrite testing code (#24568)
eleanorjboyd Dec 10, 2024
01e745d
Issue reporter uses name and publisher id (#24570)
karthiknadig Dec 10, 2024
60f4aaa
Update issue-labels.yml (#24576)
eleanorjboyd Dec 10, 2024
33b5e97
Removing duplicate word in settings description (#24577)
cwebster-99 Dec 10, 2024
32512b1
Fix for prefix conda environments (#24553)
karthiknadig Dec 11, 2024
e8f710a
Update to latest packages (#24571)
karthiknadig Dec 11, 2024
c0ea185
support skip in fixture (#24588)
eleanorjboyd Dec 12, 2024
567ca5a
Create commands.json (#24596)
bhavyaus Dec 12, 2024
f0bdf82
Remove support execution order from native repl (#24595)
anthonykim1 Dec 12, 2024
9466391
add omit coverage support for path patterns (#24599)
eleanorjboyd Dec 13, 2024
2c801b8
add error node on errored subprocess close (#24597)
eleanorjboyd Dec 13, 2024
a9f6f22
fix read streams blocking node threads (#24611)
eleanorjboyd Dec 16, 2024
cbf8eee
warn about month old stale PRs (#24615)
eleanorjboyd Dec 16, 2024
f5dfc7b
Add Github action to ensure PR's have an associated issue (#24616)
eleanorjboyd Dec 17, 2024
40fd329
endorsement_velocity_summary script (#24618)
eleanorjboyd Dec 17, 2024
4046562
update from v3 to v4 for github actions (#24619)
eleanorjboyd Dec 17, 2024
6971fda
cleanup eslintignore file and create cleanup script (#24617)
eleanorjboyd Dec 17, 2024
bf46284
Fix 'coverage.exceptions.NoSource` import to fallback to previous exc…
GeorgeNikitinNV Dec 17, 2024
be91da1
Bump actions/setup-python from 2 to 5 (#24621)
dependabot[bot] Dec 17, 2024
5ec7510
Bump actions/github-script from 4 to 7 (#24622)
dependabot[bot] Dec 17, 2024
d50b7cc
Bump actions/checkout from 2 to 4 (#24623)
dependabot[bot] Dec 17, 2024
de13d42
make vscode-python specific (#24598)
eleanorjboyd Dec 17, 2024
a76e7ef
remove console. in production code (#24629)
eleanorjboyd Dec 17, 2024
25ecab8
fix gen velocity script (#24634)
eleanorjboyd Dec 17, 2024
de988ff
Remove dead tensorboard code (#24641)
DonJayamanne Dec 19, 2024
3ccf984
Remove fifo regression (#24685)
eleanorjboyd Jan 6, 2025
ef6ca9f
Fix fifo communication for large testing projects (#24690)
eleanorjboyd Jan 6, 2025
520f396
switch to use file path as key in building test tree (#24697)
eleanorjboyd Jan 8, 2025
2ebfae9
remove commands for python.refreshTensorBoard and python.launchTensor…
eleanorjboyd Jan 8, 2025
dcfcdc2
support pytest-ruff plugin for testing (#24698)
eleanorjboyd Jan 8, 2025
e772738
remove stale PR check (#24708)
eleanorjboyd Jan 9, 2025
9bc9f68
stray debugging print left behind (#24710)
eleanorjboyd Jan 10, 2025
74a5cad
Restrict conda binary to be from PATH or Settings (#24709)
karthiknadig Jan 10, 2025
4d45042
Update release_plan.md (#24719)
eleanorjboyd Jan 14, 2025
8c54b8a
Discovery cancellation (#24713)
eleanorjboyd Jan 14, 2025
92cc4ed
Update pylance telemetry for new experiment (#24731)
rchiodo Jan 21, 2025
25411e5
Launch Native REPL using terminal link (#24734)
anthonykim1 Jan 23, 2025
4322684
Remove env var collection related debris in pythonStartup test (#24739)
anthonykim1 Jan 23, 2025
803704e
Bigger native repl suggestion link on terminal (#24751)
anthonykim1 Jan 28, 2025
38527d6
Resolve >= 3.13 failing REPL CI tests (#24775)
anthonykim1 Feb 3, 2025
6f1ea1d
bump-release-2025.0 (#24778)
eleanorjboyd Feb 3, 2025
d95649c
Bump dev version 2025.1 (#24779)
eleanorjboyd Feb 3, 2025
e9b4b7b
update release plan to move release branching to prior thurs (#24781)
eleanorjboyd Feb 4, 2025
6b784e5
Use sendText to send Python code to Terminal REPL for Python >= 3.13 …
anthonykim1 Feb 4, 2025
b4e1ddb
Jupyter API to get Env associated with Notebooks (#24771)
DonJayamanne Feb 4, 2025
d5b19e7
add extra newline to execute when returning dictionary (#24784)
anthonykim1 Feb 5, 2025
bf38fc5
Add "Native" in front of "Python REPL" under Run Python menu (#24785)
anthonykim1 Feb 5, 2025
9578785
Fix event duplication when using Python Environments (#24786)
karthiknadig Feb 6, 2025
e8ed713
Update Pylance GDPR tags (#24794)
luabud Feb 6, 2025
32c2cf9
add check for tmp dir access error on testIds file (#24798)
eleanorjboyd Feb 7, 2025
0983657
improve logging for python testing (#24799)
eleanorjboyd Feb 7, 2025
b4aa112
handle un-analyzable files in coverage run (#24800)
eleanorjboyd Feb 7, 2025
79e8a13
Always use environment path when running conda environment commands (…
jpcorreia99 Feb 14, 2025
08e228d
Introduce `autoTestDiscoverOnSavePattern` configuration option (#24728)
soceanainn Feb 14, 2025
2bcd557
Ensure Python Terminal Shell Integration setting is effective without…
anthonykim1 Feb 18, 2025
7697cf3
Bump elliptic from 6.6.0 to 6.6.1 (#24819)
dependabot[bot] Feb 18, 2025
42962ce
Bump serialize-javascript and mocha (#24820)
dependabot[bot] Feb 18, 2025
b84fce2
Prevent python extension from overriding gitbash pwd (#24832)
anthonykim1 Feb 21, 2025
2698d5a
remove TERMINAL_DEACTIVATE_PROMPT telemetry event (#24843)
eleanorjboyd Feb 24, 2025
cd992fc
remove stale debugging telemetry (#24842)
eleanorjboyd Feb 24, 2025
60d0473
fix: identify script/module launch vs repl launch from terminal (#24844)
karthiknadig Feb 24, 2025
5cdbc60
fix: ensure interpreter change event is raised when using environment…
karthiknadig Feb 24, 2025
7fd5cb3
Bump release 2025.2.0 (#24853)
anthonykim1 Feb 28, 2025
054e682
Bump to 2025.3.0-dev (#24854)
anthonykim1 Feb 28, 2025
a9c38bf
remove airbnb rules (#24867)
eleanorjboyd Mar 5, 2025
5f31ebb
update eslint version (#24868)
eleanorjboyd Mar 5, 2025
0c4a30d
switch to use eslint.config.mjs (#24882)
eleanorjboyd Mar 7, 2025
e71bfd6
default to XDG_RUNTIME_DIR for mac/linux in temp file for testing com…
eleanorjboyd Mar 7, 2025
067e8ef
add no bad gdpr comments plugin (#24884)
eleanorjboyd Mar 7, 2025
f12d5bc
remove old .eslintrc and ignore file (#24883)
eleanorjboyd Mar 7, 2025
6b7d8d1
Ensure survey notification respects telemetry.disableFeedback setting…
luabud Mar 14, 2025
6a60c92
move clear envCollection to after await (#24921)
eleanorjboyd Mar 19, 2025
c51cdd3
fix: use vsceTarget to rustTarget conversion when pulling `pet` (#24925)
karthiknadig Mar 24, 2025
725d539
Update condarc.json (#24918)
Sclafus Mar 24, 2025
e0cbc9a
Use new feedback setting (#24929)
luabud Mar 26, 2025
4df044f
update to v2025.4.0 for release (#24934)
eleanorjboyd Mar 28, 2025
237f6b6
bump to 2025.5.0-dev (#24936)
eleanorjboyd Mar 28, 2025
175a35d
fix: temp for PR file check failure (#24939)
karthiknadig Mar 29, 2025
18efcd6
Bump tar-fs from 2.1.1 to 2.1.2 (#24940)
dependabot[bot] Mar 31, 2025
944c204
Set native repl to default to false, remove experiment (#24952)
anthonykim1 Apr 1, 2025
41e6624
fix: log only the required environment variables (#24937)
karthiknadig Apr 1, 2025
6a20c9c
fix: use wrapper functions for easier testing (#24941)
karthiknadig Apr 2, 2025
3275c34
prevent native REPL from caching state between sessions (#24857)
hutch3232 Apr 2, 2025
affbd1b
Remove debris from smart send experiment (#24957)
anthonykim1 Apr 2, 2025
cd714bf
force absolute path for coverage results (#24948)
eleanorjboyd Apr 2, 2025
cf91dc8
remove ITestLogChannel (#24954)
eleanorjboyd Apr 2, 2025
70a36f5
fix: use latest `pet` (#24964)
karthiknadig Apr 3, 2025
e9fb2bf
Django Test Runs with Coverage (#24927)
danila-grobov Apr 3, 2025
bb6e909
Test Coverage for older django versions (#24968)
danila-grobov Apr 7, 2025
a9c9152
Update pylance.ts (#24959)
luabud Apr 9, 2025
8478bf0
Bump typing-extensions from 4.12.2 to 4.13.2 (#24977)
dependabot[bot] Apr 14, 2025
2a35668
fix: ensure that we use new extension when available for terminal cre…
karthiknadig Apr 14, 2025
f319416
Add metadata for Pylance's documentcolor_slow telemetry event (#24979)
debonte Apr 14, 2025
4b7650e
support branch coverage for testing (#24980)
eleanorjboyd Apr 14, 2025
c3f601d
Added some pylance telemetry (#24984)
heejaechang Apr 15, 2025
6608f9a
fix: let Python Envs extension handle missing `python` in conda envs …
karthiknadig Apr 17, 2025
cf894bb
Revert "move clear envCollection to after await (#24921)" (#24988)
karthiknadig Apr 17, 2025
cfc65ab
fix: terminal error notification in untrusted workspace (#24993)
karthiknadig Apr 18, 2025
ee8f230
chore: update required dependencies (#24998)
karthiknadig Apr 22, 2025
43285f6
feat: update to `jedi-language-server` v0.45.0 (#24997)
karthiknadig Apr 22, 2025
5a33fc1
fix: ensure options are passed to python envs (#25001)
karthiknadig Apr 22, 2025
7fea432
Disable language services if Pyrefly extension installed + active (#2…
kinto0 Apr 23, 2025
2e023d4
Added some GDPR for pylance (#25004)
heejaechang Apr 23, 2025
e93a075
feat: enable semantic tokens in Jedi language server analysis options…
karthiknadig Apr 24, 2025
d597e1c
bump to release 2025.6 (#25033)
eleanorjboyd May 2, 2025
b44b4d4
bump: update version to 2025.7.0-dev in package.json (#25034)
eleanorjboyd May 2, 2025
0317c6b
PYTHONSTARTUP should be injected regardless of terminalEnv experiment…
anthonykim1 May 6, 2025
a3dd3aa
Add shortTitle to execSelectionInTerminal command (#25007)
dineshcsdev May 6, 2025
b0b8aff
Added pylock to activationevents (#25025)
albus-droid May 7, 2025
09ef3c4
chore: lock down workflows (#25047)
rzhao271 May 9, 2025
8892ce6
Fix env error handling (#25049)
s-kai273 May 12, 2025
d6b62de
Fix msys2 venv path (#25062)
s-kai273 May 13, 2025
e709012
Updates to latest version of VS Code types (#25065)
DonJayamanne May 13, 2025
4367614
Port Python Env Tools (#25066)
DonJayamanne May 14, 2025
84280b0
fix regression with import packaging for branch coverage (#25070)
eleanorjboyd May 15, 2025
d06eb18
chore: ensure `.env` files are excluded from vsix
karthiknadig May 15, 2025
9fd7b9b
Rename llm tools (#25078)
DonJayamanne May 15, 2025
5045cdd
More specific llm tools (#25072)
DonJayamanne May 16, 2025
c246e0e
API to get last used env in a LM tool (#25079)
DonJayamanne May 16, 2025
98aaab1
Tweak Python shell integration for lsp completion (#25082)
anthonykim1 May 17, 2025
27270db
Ensure python selector supports returning created env (#25088)
DonJayamanne May 19, 2025
d7a5ab7
Ability to track the user selected Environment (#25090)
DonJayamanne May 20, 2025
4a602e8
Configure Python Env tool (#25091)
DonJayamanne May 20, 2025
020f203
fix: ensure we always return `undefined` for invalid envs (#25092)
karthiknadig May 20, 2025
8ae346b
Prefer using Notebook tools over Python tools for notebooks (#25098)
DonJayamanne May 21, 2025
eed5eb0
Add activation events for tools (#25104)
DonJayamanne May 23, 2025
2db24aa
Remove single quotes surrounding displayed venv (#25102)
cpinamtz May 23, 2025
5035e88
Configuration tool with improved workflow and UX (#25106)
DonJayamanne May 27, 2025
186bedd
Update lm tool tags (#25108)
DonJayamanne May 27, 2025
1d682db
Support additional args for create venv tool (#25112)
DonJayamanne May 27, 2025
b35d198
Update tool args (#25113)
DonJayamanne May 28, 2025
ef01ace
Update lm tool tags (#25114)
DonJayamanne May 28, 2025
9b17438
All Python lm tools in Python extension (#25116)
DonJayamanne May 29, 2025
70e17fc
Ensure we do not support the tools in an untrusted workspace (#25142)
DonJayamanne Jun 4, 2025
02476f0
Bump tar-fs from 2.1.2 to 2.1.3 (#25138)
dependabot[bot] Jun 4, 2025
26fe443
Bump to 2025.8.0 (#25148)
anthonykim1 Jun 5, 2025
7d8ac2f
bump to 2025.9 (#25149)
anthonykim1 Jun 5, 2025
5070566
Hide progress messages when creating env or installing packages (#25174)
DonJayamanne Jun 17, 2025
2faa164
fix linting (#25194)
eleanorjboyd Jun 19, 2025
df13df0
add python.useEnvironmentsExtension (#25204)
eleanorjboyd Jun 23, 2025
cde514f
Update node to 20.18.1 (#25205)
anthonykim1 Jun 23, 2025
e5e5241
Bump pbkdf2 from 3.0.17 to 3.1.3 (#25207)
dependabot[bot] Jun 24, 2025
01d872b
Disable PyREPL (#25216)
anthonykim1 Jun 26, 2025
180ba38
Capture invocation and failure reasons for tools (#25220)
DonJayamanne Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Django Test Runs with Coverage (microsoft#24927)
microsoft#24199

Co-authored-by: Danila Grobov (s4642g) <[email protected]>
  • Loading branch information
danila-grobov and DanilaGrobovSEB authored Apr 3, 2025
commit e9fb2bf1462689dc717bf611aa344dc6950ee144
1 change: 1 addition & 0 deletions build/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ django-stubs
coverage
pytest-cov
pytest-json
pytest-timeout


# for pytest-describe related tests
Expand Down
2 changes: 1 addition & 1 deletion python_files/tests/pytestadapter/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def runner_with_cwd_env(
"""
process_args: List[str]
pipe_name: str
if "MANAGE_PY_PATH" in env_add:
if "MANAGE_PY_PATH" in env_add and "COVERAGE_ENABLED" not in env_add:
# If we are running Django, generate a unittest-specific pipe name.
process_args = [sys.executable, *args]
pipe_name = generate_random_pipe_name("unittest-discovery-test")
Expand Down
40 changes: 40 additions & 0 deletions python_files/tests/unittestadapter/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import pathlib
import sys

import pytest

sys.path.append(os.fspath(pathlib.Path(__file__).parent))

python_files_path = pathlib.Path(__file__).parent.parent.parent
Expand Down Expand Up @@ -49,3 +51,41 @@ def test_basic_coverage():
assert focal_function_coverage.get("lines_missed") is not None
assert set(focal_function_coverage.get("lines_covered")) == {4, 5, 7, 9, 10, 11, 12, 13, 14}
assert set(focal_function_coverage.get("lines_missed")) == {6}


@pytest.mark.timeout(30)
def test_basic_django_coverage():
"""This test validates that the coverage is correctly calculated for a Django project."""
data_path: pathlib.Path = TEST_DATA_PATH / "simple_django"
manage_py_path: str = os.fsdecode(data_path / "manage.py")
execution_script: pathlib.Path = python_files_path / "unittestadapter" / "execution.py"

test_ids = [
"polls.tests.QuestionModelTests.test_was_published_recently_with_future_question",
"polls.tests.QuestionModelTests.test_was_published_recently_with_future_question_2",
"polls.tests.QuestionModelTests.test_question_creation_and_retrieval",
]

script_str = os.fsdecode(execution_script)
actual = helpers.runner_with_cwd_env(
[script_str, "--udiscovery", "-p", "*test*.py", *test_ids],
data_path,
{
"MANAGE_PY_PATH": manage_py_path,
"_TEST_VAR_UNITTEST": "True",
"COVERAGE_ENABLED": os.fspath(data_path),
},
)

assert actual
coverage = actual[-1]
assert coverage
results = coverage["result"]
assert results
assert len(results) == 15
polls_views_coverage = results.get(str(data_path / "polls" / "views.py"))
assert polls_views_coverage
assert polls_views_coverage.get("lines_covered") is not None
assert polls_views_coverage.get("lines_missed") is not None
assert set(polls_views_coverage.get("lines_covered")) == {3, 4, 6}
assert set(polls_views_coverage.get("lines_missed")) == {7}
60 changes: 37 additions & 23 deletions python_files/unittestadapter/django_handler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import importlib.util
import os
import pathlib
import subprocess
import sys
from typing import List
from contextlib import contextmanager, suppress
from typing import TYPE_CHECKING, Generator, List

if TYPE_CHECKING:
from importlib.machinery import ModuleSpec


script_dir = pathlib.Path(__file__).parent
sys.path.append(os.fspath(script_dir))
Expand All @@ -16,6 +22,17 @@
)


@contextmanager
def override_argv(argv: List[str]) -> Generator:
"""Context manager to temporarily override sys.argv with the provided arguments."""
original_argv = sys.argv
sys.argv = argv
try:
yield
finally:
sys.argv = original_argv


def django_discovery_runner(manage_py_path: str, args: List[str]) -> None:
# Attempt a small amount of validation on the manage.py path.
if not pathlib.Path(manage_py_path).exists():
Expand Down Expand Up @@ -72,31 +89,28 @@ def django_execution_runner(manage_py_path: str, test_ids: List[str], args: List
else:
env["PYTHONPATH"] = os.fspath(custom_test_runner_dir)

# Build command to run 'python manage.py test'.
command: List[str] = [
sys.executable,
django_project_dir: pathlib.Path = pathlib.Path(manage_py_path).parent
sys.path.insert(0, os.fspath(django_project_dir))
print(f"Django project directory: {django_project_dir}")

manage_spec: ModuleSpec | None = importlib.util.spec_from_file_location(
"manage", manage_py_path
)
if manage_spec is None or manage_spec.loader is None:
raise VSCodeUnittestError("Error importing manage.py when running Django testing.")
manage_module = importlib.util.module_from_spec(manage_spec)
manage_spec.loader.exec_module(manage_module)

manage_argv: List[str] = [
manage_py_path,
"test",
"--testrunner=django_test_runner.CustomExecutionTestRunner",
*args,
*test_ids,
]
# Add any additional arguments to the command provided by the user.
command.extend(args)
# Add the test_ids to the command.
print("Test IDs: ", test_ids)
print("args: ", args)
command.extend(test_ids)
print("Running Django run tests with command: ", command)
subprocess_execution = subprocess.run(
command,
capture_output=True,
text=True,
env=env,
)
print(subprocess_execution.stderr, file=sys.stderr)
print(subprocess_execution.stdout, file=sys.stdout)
# Zero return code indicates success, 1 indicates test failures, so both are considered successful.
if subprocess_execution.returncode not in (0, 1):
error_msg = "Django test execution process exited with non-zero error code See stderr above for more details."
print(error_msg, file=sys.stderr)
print(f"Django manage.py arguments: {manage_argv}")

with override_argv(manage_argv), suppress(SystemExit):
manage_module.main()
except Exception as e:
print(f"Error during Django test execution: {e}", file=sys.stderr)