-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Test discovery tries to activate conda on a non-conda directory #22581
Comments
Are you on the new testing rewrite? You can check for it by looking at |
Correct, the pythonTestAdapter is already enabled:
|
hm this is especially interesting because this seems right from your logs @karrtikr thoughts? |
This log is expected as we use this information to decide the activation mechanism, doesn't seem related. |
Oops I copied the wrong line. I was looking at this one |
It doesn't seem to recognize the type of the active interpreter: @deltamarnix Can you please provide the debug logs? Also please provide some steps to use that package manager to create such environment, as it would help us in reproducing this issue on our end.
Output for
|
I have created two logs for you. The first one is without anaconda in the path, the second one with anaconda in the path. After I reload the window, I go to the Testing tab. The package manager that I'm using is called pixi.
I hope I am complete enough with this information. My settings.json: {
"[julia]": {
"editor.formatOnSave": true
},
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"source.fixAll.ruff": true,
"source.organizeImports.ruff": true
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
},
"python.analysis.extraPaths": [
".pixi/env/Library/python"
],
"mypy-type-checker.importStrategy": "fromEnvironment",
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
".pixi": true,
".mypy_cache": true,
".pytest_cache": true,
".ruff_cache": true,
"juliaup": true
}
} Without anaconda in PATH
With anaconda in PATH
|
I started on better pixi integration in this plugin. The first PR is to detect the proper python interpreter: #22968 After that, I would like to try and tackle some of the issues mentioned here. |
@karrtikr, could you circle back on this if you have time? Thanks |
We can close this in favor of #22978. @baszalmstra As part of test plan item of #22968 (comment), we'd very much appreciate it if you could also mention to verify it fixes this issue, thanks! |
@karrtikr will do! |
Type: Bug
Behaviour
Expected vs. Actual
Expected that the testing sidebar shows all python tests that are available.
The directory used here is using pixi as package manager, and not conda. Somehow this folder is identified as a conda folder and the ms-python plugin tries to call conda, which is indeed installed on my computer and in my PATH. ms-python should not try to call conda run. I have set up my environment myself my opening visual studio code in a pixi shell.
Actual, I receive an error
DirectoryNotACondaEnvironmentError
Steps to reproduce:
pixi run code .
to open my VS code projectDiagnostic data
python.languageServer
setting: Default"python.terminal.activateEnvironment": false,
in my personal settings.Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.21.13351006
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: