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

Pixi errror when loading pytest in VS code #23773

Closed
adam-lagoda opened this issue Jul 9, 2024 · 60 comments
Closed

Pixi errror when loading pytest in VS code #23773

adam-lagoda opened this issue Jul 9, 2024 · 60 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@adam-lagoda
Copy link

Type: Bug

Behaviour

I get a pytest discovery error when starting pytest from the vs code testing window. The systems utilizes micromamba as the python package manager, with an alias set up between conda -> micromamba. The error originates from pixi not being found,

Steps to reproduce:

  1. Use micromamba environment that is activated in powershell
  2. Open VSCode and the testing toolbar (with the Python Extension set to 2024.10.0)
  3. Tests will not be discovered

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 2024.10.0
VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:52:22.949Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Micromamba
  • Value of the python.languageServer setting: Default
User Settings


condaPath: "<placeholder>"

languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
CodeSnap adpyke.codesnap 1.3.4
CSV to Table phplasma.csv-to-table 1.4.0
Data Wrangler ms-toolsai.datawrangler 1.4.1
FindItFaster TomRijndorp.find-it-faster 0.0.38
Git Graph mhutchie.git-graph 1.30.0
GitLens — Git supercharged eamodio.gitlens 15.1.0
Hex Editor ms-vscode.hexeditor 1.10.0
JavaScript Debugger ms-vscode.js-debug 1.91.0
json ZainChen.json 2.0.2
Jupyter ms-toolsai.jupyter 2024.6.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.18
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Live Preview ms-vscode.live-server 0.4.13
Path Intellisense christian-kohler.path-intellisense 2.9.0
Pretty Formatter mblode.pretty-formatter 0.2.4
Pylance ms-python.vscode-pylance 2024.6.1
Python ms-python.python 2024.11.2024070801
Python Debugger ms-python.debugpy 2024.6.0
Rainbow CSV mechatroner.rainbow-csv 3.12.0
SQLite alexcvzz.vscode-sqlite 0.14.1
SVG jock.svg 1.5.4
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
Todo Tree Gruntfuggly.todo-tree 0.0.226
System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
GPU Status 2d_canvas: enabled
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 23.71GB (5.42GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu-22.04/home/adam/Documents/Git/QUIET --remote=wsl+Ubuntu-22.04
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-22.04
OS Linux x64 5.15.153.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 0)
Memory (System) 11.54GB (9.78GB free)
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 9, 2024
@adam-lagoda
Copy link
Author

image

@rafrafek
Copy link

rafrafek commented Jul 9, 2024

I have the same issue that started occurring after the latest VS Code Python extension update. I use Poetry to create my virtual environments, and I don't even know what Pixi is.

I'm getting a "pytest Discovery Error" and am unable to launch any tests in VS Code.

@adam-lagoda
Copy link
Author

I have tested that downgrading to v2024.8.1 works @rafrafek. However this is a temporary solution, and I would highly appreciate fixing the bug by the core team

@rafrafek
Copy link

rafrafek commented Jul 9, 2024

My logs:

2024-07-09 14:41:13.122 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTestAdapter' is active
2024-07-09 14:41:13.122 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/username/Projects/project-name/.pixi/envs'
	at Object.readdirSync (node:fs:1515:3)
	at t.readdirSync (node:electron/js2c/node_init:2:11289)
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574598
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574507)
	at async d.ensureWatchersReady (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:536827)] {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/username/Projects/project-name/.pixi/envs'
}
2024-07-09 14:41:13.122 [error] Dir "/Users/username/Projects/project-name/.pixi/envs" is not watchable (directory does not exist)
2024-07-09 14:41:13.154 [info] Default formatter is set to null for workspace /Users/username/Projects/project-name
2024-07-09 14:41:13.157 [info] Python interpreter path: ./.venv/bin/python
2024-07-09 14:41:13.282 [info] > pyenv which python
2024-07-09 14:41:13.282 [info] cwd: .
2024-07-09 14:41:13.915 [info] > pixi --version
2024-07-09 14:41:13.916 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-07-09 14:41:13.916 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.487 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.497 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/printEnvVariables.py
2024-07-09 14:41:14.497 [info] shell: bash
2024-07-09 14:41:14.527 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.528 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only tests
2024-07-09 14:41:14.528 [info] cwd: .
2024-07-09 14:41:14.657 [error] Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 150, in main
    
2024-07-09 14:41:14.658 [error] config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])

2024-07-09 14:41:14.658 [error]   File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse

2024-07-09 14:41:14.658 [error]     self.parse(args)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1301, in _preparse

2024-07-09 14:41:14.659 [error]     self.pluginmanager.consider_preparse(args, exclude_only=False)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 709, in consider_preparse

2024-07-09 14:41:14.659 [error]     self.consider_pluginarg(parg)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 735, in consider_pluginarg

2024-07-09 14:41:14.659 [error]     self.import_plugin(arg, consider_entry_points=True)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 781, in import_plugin

2024-07-09 14:41:14.659 [error]     __import__(importspec)

2024-07-09 14:41:14.659 [error]   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 895, in <module>
    class DeferPlugin:
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 896, in DeferPlugin
    @pytest.hookimpl(wrapper=True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HookimplMarker.__call__() got an unexpected keyword argument 'wrapper'

2024-07-09 14:41:14.676 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name.
2024-07-09 14:41:14.677 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name. Creating and sending error discovery payload
2024-07-09 14:41:14.677 [error] pytest test discovery error for workspace:  /Users/username/Projects/project-name 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/username/Projects/project-name

@eleanorjboyd
Copy link
Member

Hi! What version of pytest are you using? It might be due to you being on a older version and updating might fix your problem.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 9, 2024
@rafrafek
Copy link

rafrafek commented Jul 9, 2024

Hi! I'm using version 7.4.4, and updating to the latest version 8.2.2 fixed the issue in my case. I'm not the author of this issue, though, so I would wait to confirm if it helps in that case.

@paulf81
Copy link

paulf81 commented Jul 10, 2024

I have also had this issue

@jk1man1
Copy link

jk1man1 commented Jul 10, 2024

I had the same problem. It seems that having the pytest verion 7.4.4, and updating to the latest version 8.2.2, fixed the issue on my end

@adam-lagoda
Copy link
Author

I have now checked my environment package versions, and I had pytest running also running on 7.4.4, however, as @jk1man1 and @rafrafek pointed out, 8.2.2 works out of the box. I have also tested, and 7.4.0 works as well.
I am therefore closing this issue, as not relevant for vscode-python

@adam-lagoda adam-lagoda closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 10, 2024
@Ivanli-RT
Copy link

My logs:

2024-07-09 14:41:13.122 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTestAdapter' is active
2024-07-09 14:41:13.122 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/username/Projects/project-name/.pixi/envs'
	at Object.readdirSync (node:fs:1515:3)
	at t.readdirSync (node:electron/js2c/node_init:2:11289)
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574598
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574507)
	at async d.ensureWatchersReady (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:536827)] {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/username/Projects/project-name/.pixi/envs'
}
2024-07-09 14:41:13.122 [error] Dir "/Users/username/Projects/project-name/.pixi/envs" is not watchable (directory does not exist)
2024-07-09 14:41:13.154 [info] Default formatter is set to null for workspace /Users/username/Projects/project-name
2024-07-09 14:41:13.157 [info] Python interpreter path: ./.venv/bin/python
2024-07-09 14:41:13.282 [info] > pyenv which python
2024-07-09 14:41:13.282 [info] cwd: .
2024-07-09 14:41:13.915 [info] > pixi --version
2024-07-09 14:41:13.916 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-07-09 14:41:13.916 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.487 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.497 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/printEnvVariables.py
2024-07-09 14:41:14.497 [info] shell: bash
2024-07-09 14:41:14.527 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.528 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only tests
2024-07-09 14:41:14.528 [info] cwd: .
2024-07-09 14:41:14.657 [error] Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 150, in main
    
2024-07-09 14:41:14.658 [error] config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])

2024-07-09 14:41:14.658 [error]   File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse

2024-07-09 14:41:14.658 [error]     self.parse(args)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1301, in _preparse

2024-07-09 14:41:14.659 [error]     self.pluginmanager.consider_preparse(args, exclude_only=False)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 709, in consider_preparse

2024-07-09 14:41:14.659 [error]     self.consider_pluginarg(parg)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 735, in consider_pluginarg

2024-07-09 14:41:14.659 [error]     self.import_plugin(arg, consider_entry_points=True)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 781, in import_plugin

2024-07-09 14:41:14.659 [error]     __import__(importspec)

2024-07-09 14:41:14.659 [error]   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 895, in <module>
    class DeferPlugin:
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 896, in DeferPlugin
    @pytest.hookimpl(wrapper=True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HookimplMarker.__call__() got an unexpected keyword argument 'wrapper'

2024-07-09 14:41:14.676 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name.
2024-07-09 14:41:14.677 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name. Creating and sending error discovery payload
2024-07-09 14:41:14.677 [error] pytest test discovery error for workspace:  /Users/username/Projects/project-name 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/username/Projects/project-name

my error log is all the same

@eleanorjboyd
Copy link
Member

Hi, seems like this is actually this error: #23707 and therefore a duplicate. I am putting in a fix hopefully today for it. Lmk if you aren't seeing this error and are seeing something else and I can reopen thank you!

@rafrafek
Copy link

rafrafek commented Jul 10, 2024

If someone wants to stay on Pytest version 7.x, can just bump pluggy https://pypi.org/project/pluggy/ to version 1.5.0.

#23707 (comment)

@garganpaull
Copy link

Ive got the same problem which started today. Am using Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

[warning] could not find a pixi interpreter for the interpreter at c:\venv\Scripts\python.exe
...
File "c:\venv\lib\site-packages\pluggy_manager.py", line 211, in unregister
assert name is not None, "plugin is not registered"
AssertionError: plugin is not registered

The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace

@eleanorjboyd
Copy link
Member

@garganpaull are you trying to use pixi?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 11, 2024
@garganpaull
Copy link

garganpaull commented Jul 11, 2024

@garganpaull are you trying to use pixi?

No. I dont even know what Pixi is.

My colleague does not have this issue and is running Pytest version is 7.2.0, Python version is 3.10.2 using VS Code v1.86.2.

Im using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

This issue only started for me yesterday when I upgraded my VS Code

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 11, 2024
@loomanss
Copy link

loomanss commented Jul 12, 2024

my steps to a solution:

  • poetry update pytest
  • removed .venv folder
  • updated python version from 3.10 to 3.11 in pyrpoject.toml
  • removed poetry.lock
  • poetry env use 3.11
  • poetry install

ended up with
pytest 8.2.2
pluggy 1.5.0

@jepManalo
Copy link

jepManalo commented Jul 12, 2024

I am actually also encountering this pixi error on my VS Code after the update. Right now, pytest Discovery is displaying errors that I have never seen before.

My current Versions are:
pytest 7.2.2
pytest bdd 7.1.2
pluggy 1.0.0
VSCode 1.91.1
python 3.8.10

Here is the complete error:

`2024-07-12 15:09:10.914 [info] Experiment 'pythonaacf' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonTestAdapter' is active
2024-07-12 15:09:10.915 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir 'c:<project_name>.pixi\envs'
at Object.readdirSync (node:fs:1515:3)
at t.readdirSync (node:electron/js2c/node_init:2:11289)
at c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574598
at c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574789
at Array.map ()
at d.initWatchers (c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574507)
at async d.ensureWatchersReady (c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:536827)] {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: 'c:\<project_name>\.pixi\envs'
}
2024-07-12 15:09:10.915 [error] Dir "c:<project_name>.pixi\envs" is not watchable (directory does not exist)
2024-07-12 15:09:10.915 [info] Default formatter is set to null for workspace c:<project_name>
2024-07-12 15:09:10.958 [info] Python interpreter path: ..venv\Scripts\python.exe
2024-07-12 15:09:11.763 [info] > pyenv which python
2024-07-12 15:09:11.763 [info] cwd: .
2024-07-12 15:09:11.848 [info] > conda info --json
2024-07-12 15:09:12.491 [info] > pixi --version
2024-07-12 15:09:12.511 [error] [Error: spawn pixi ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn pixi',
path: 'pixi',
spawnargs: [ '--version' ]
}
2024-07-12 15:09:12.512 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:12.803 [info] > & ./.venv/Scripts/Activate.ps1 ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:12.803 [info] shell: powershell
2024-07-12 15:09:14.207 [info] Discover tests for workspace name: <project_name> - uri: c:<project_name>
2024-07-12 15:09:14.207 [info] Running discovery for pytest using the new test adapter.
2024-07-12 15:09:14.231 [warning] The cwd resolves to a different path, checking if it has a symbolic link somewhere in its path.
2024-07-12 15:09:14.233 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:14.562 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:14.562 [info] shell: commandPrompt
2024-07-12 15:09:14.841 [info] > C:\ProgramData\anaconda3\Scripts\conda.exe info --json
2024-07-12 15:09:15.309 [info] > ~\AppData\Local\Programs\Python\Python38\python.exe ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:15.309 [info] shell: powershell
2024-07-12 15:09:15.312 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:15.335 [info] > ..venv\Scripts\python.exe -m pytest -p vscode_pytest --collect-only .
2024-07-12 15:09:15.335 [info] cwd: .
2024-07-12 15:09:15.417 [info] Starting Pylance language server.
2024-07-12 15:09:16.116 [info] Prepending environment variable PATH in collection with c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\deactivate\powershell;C:<project_name>.venv\Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-12 15:09:16.116 [info] Setting environment variable VIRTUAL_ENV in collection to C:<project_name>.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-12 15:09:16.909 [error] Traceback (most recent call last):
File "C:\Users<username>\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users<username>\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:<project_name>.venv\lib\site-packages\pytest_main
.py", line 5, in
raise SystemExit(pytest.console_main())
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 189, in console_main
code = main()
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 147, in main
config = prepareconfig(args, plugins)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 328, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "c:<project_name>.venv\lib\site-packages\pluggy_hooks.py", line 265, in call
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "c:<project_name>.venv\lib\site-packages\pluggy_manager.py", line 80, in hookexec
return self.inner_hookexec(hook_name, methods, kwargs, firstresult)
File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 55, in multicall
gen.send(outcome)
File "c:<project_name>.venv\lib\site-packages_pytest\helpconfig.py", line 103, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "c:<project_name>.venv\lib\site-packages\pluggy_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 39, in multicall
res = hook_impl.function(*args)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1075, in pytest_cmdline_parse
self.parse(args)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1425, in parse
self.preparse(args, addopts=addopts)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1301, in preparse
self.pluginmanager.consider_preparse(args, exclude_only=False)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 710, in consider_preparse
self.consider_pluginarg(parg)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 736, in consider_pluginarg
self.import_plugin(arg, consider_entry_points=True)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 782, in import_plugin
import(importspec)
File "", line 991, in _find_and_load
File "", line 975, in find_and_load_unlocked
File "", line 671, in load_unlocked
File "c:<project_name>.venv\lib\site-packages_pytest\assertion\rewrite.py", line 178, in exec_module
exec(co, module.dict)
File "c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest_init
.py", line 895, in
class DeferPlugin:
File "c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest_init
.py", line 896, in DeferPlugin
@pytest.hookimpl(wrapper=True)
TypeError: call() got an unexpected keyword argument 'wrapper'

2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>.
2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>. Creating and sending error discovery payload
2024-07-12 15:09:16.987 [error] pytest test discovery error for workspace: c:<project_name>

The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace c:<project_name>
`

@zljubisic
Copy link

I can report the same problem. In my output log I can find:
2024-07-16 12:15:12.324 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/home/path_to_the_project/.pixi/envs'

Apart from it, I can also find this in my output log:

2024-07-16 12:18:22.351 [info] INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0

2024-07-16 12:18:22.351 [info] INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 677, in perform_collect
INTERNALERROR>     self.config.pluginmanager.check_pending()
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 384, in check_pending
INTERNALERROR>     raise PluginValidationError(
INTERNALERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_xdist_auto_num_workers' in plugin <vscode_pytest.DeferPlugin object at 0x7f1936d327d0>

I don't know if it is related to pixi.

@garganpaull
Copy link

@garganpaull are you trying to use pixi?

No. I dont even know what Pixi is.

My colleague does not have this issue and is running Pytest version is 7.2.0, Python version is 3.10.2 using VS Code v1.86.2.

Im using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

This issue only started for me yesterday when I upgraded my VS Code

Is this fixed yet as problem still persists.

@rafrafek
Copy link

I'm using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

Can you try with Python 3.10.14? Python 3.10.6 is 2 years old and there were many fixes between 3.10.6 and 3.10.14.

@toddsayersshell
Copy link

Also having this issue. I have no idea about or intention to use Pixi.

@thethiny

This comment was marked as off-topic.

@zljubisic
Copy link

And what now? To open a new issue and ask to reopen this one?
@eleanorjboyd can we avoid it?

@anatesan-stream
Copy link

anatesan-stream commented Sep 21, 2024

You won't see the --version as error nor "2024-07-16 12:15:12.324 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/home/path_to_the_project/.pixi/envs'". Try clearing the output and downloading the latest version of Python extension. Related: https://github.com//pull/23942

@anthonykim1 I can confirm that the issue is still present in vscode:

Version: 1.93.0 (user setup)
Commit: 4849ca9bdf9666755eb463db297b69e5385090e3
Date: 2024-09-04T13:02:38.431Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

And python extension v2024.14.1

$ pytest --version
pytest 8.3.3

From python output:

...
2024-09-14 15:28:56.260 [info] > ~/miniconda3/bin/conda run -n state_machine --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/python_files/printEnvVariables.py
2024-09-14 15:28:56.260 [info] shell: bash
2024-09-14 15:28:57.879 [info] > pixi --version
2024-09-14 15:28:57.880 [warning] could not find a pixi interpreter for the interpreter at /home/zoran/miniconda3/envs/state_machine/bin/python
2024-09-14 15:28:57.886 [info] > python -m pytest -p vscode_pytest --collect-only tests
2024-09-14 15:28:57.886 [info] cwd: .
2024-09-14 15:28:57.914 [error] /home/zoran/miniconda3/bin/python: No module named pytest

2024-09-14 15:28:57.933 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/zoran/state_machine.
2024-09-14 15:28:57.933 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/zoran/state_machine. Creating and sending error discovery payload
2024-09-14 15:28:57.933 [error] pytest test discovery error for workspace:  /home/zoran/state_machine 

  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /home/zoran/state_machine

If I run pytest directly from integrated terminal, everything works:

$ pytest --collect-only
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/zoran/state_machine
configfile: pyproject.toml
collected 1 item                                                                                                                                                                                                                                         

<Dir state_machine>
  <Dir tests>
    <Module test_example.py>
      <Function test_bla>

=============================================================================================================== 1 test collected in 8.04s ================================================================================================================

After reloading window I can see that pytest is now not accessible from vscode:

2024-09-14 15:39:35.866 [info] shell: bash
2024-09-14 15:39:36.827 [info] > pixi --version
2024-09-14 15:39:36.828 [warning] could not find a pixi interpreter for the interpreter at /home/zoran/miniconda3/envs/state_machine/bin/python
2024-09-14 15:39:36.839 [info] > python -m pytest -p vscode_pytest --collect-only tests
2024-09-14 15:39:36.839 [info] cwd: .
2024-09-14 15:39:36.863 [error] /home/zoran/miniconda3/bin/python: No module named pytest

2024-09-14 15:39:36.876 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/zoran/state_machine.
2024-09-14 15:39:36.876 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/zoran/state_machine. Creating and sending error discovery payload
2024-09-14 15:39:36.876 [error] pytest test discovery error for workspace:  /home/zoran/state_machine 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /home/zoran/state_machine

But I can access it from integrated terminal. I can confirm that proper interpreter is selected (from state_machine).

$ pytest --collect-only
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/zoran/state_machine
configfile: pyproject.toml
collected 2 items                                                                                                                                                                                                                                        

<Dir state_machine>
  <Dir tests>
    <Module test_example.py>
      <Function test_bla>
      <Function test_bla2>

=============================================================================================================== 2 tests collected in 0.04s ===============================================================================================================
(state_machine) (base) zoran@WSL:~/state_machine main
$ pytest
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.11.9, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/zoran/state_machine
configfile: pyproject.toml
collected 2 items                                                                                                                                                                                                                                        

tests/test_example.py ..                                                                                                                                                                                                                           [100%]

=================================================================================================================== 2 passed in 8.38s ====================================================================================================================
(state_machine) (base) zoran@WSL:~/state_machine main

Probably we have multiple problems here, but problem exists.

Hint: It is enough to downgrade python extension to v2024.9.1 and everything works.

Downgrading Python extension to v2024.9.1 did not work for me either. Other version info from VSCode

Version: 1.93.1 (user setup)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

@anthonykim1
Copy link

Probably we have multiple problems here, but problem exists.

@zljubisic You are probably right. It seems like mix of couple problems and confusions. Let's try to solve this puzzle one by one - that being said I'm putting up a PR to change log level on this pixi warning to see and hoping it will clear up things. https://github.com/microsoft/vscode-python/pull/24164/files this way pixi warnings won't be screaming at you even when you are irrelevant (you don't have pixi nor do not intend to use one)

Can't connect the dots between how pixi warning is related to pytest at the moment.

@clement-chaneching If you are still suffering from your pixi environment not being discovered, you can file a separate issue. Give #23975 (comment) a read for your pixi specific related problems though.

@toddsayersshell FYI It is not Microsoft who closed this issue.

Thanks

@zljubisic
Copy link

@anthonykim1 thanks for your reply. PR you have mentioned will help us not to see pixi warning, but problem with pytest discovery within vscode remains. Which issue will track that?
If the issue is this one, we could ask @adam-lagoda to reopen it (if possible).

@adam-lagoda adam-lagoda reopened this Sep 24, 2024
@adam-lagoda
Copy link
Author

Downgrading the Python Extension initially has worked for me. Right now I am running v2024.14.1 and VSCode 1.93.1 without issues

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Sep 24, 2024
@oldgithubman

This comment was marked as off-topic.

eleanorjboyd pushed a commit that referenced this issue Sep 24, 2024
…24164)

Reference: #23773 and
#23773 (comment)

It seems that pixi warnings may be confusing unnecessary confusion among
folks who may not even intend to use pixi environment. Changing log
level for clarity and further help diagnosing problems that may be
unrelated to pixi.
@eleanorjboyd
Copy link
Member

this issue seems related with the incorrect environment being selected for python when testing: #24122

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Sep 24, 2024
@zljubisic

This comment was marked as off-topic.

@oldgithubman

This comment was marked as off-topic.

@toddsayersshell

This comment was marked as off-topic.

@oldgithubman

This comment was marked as off-topic.

@anatesan-stream

This comment was marked as off-topic.

@karthiknadig
Copy link
Member

We are actively investigating this. The short answer is, we are not able to isolate the issue. If we can't isolate it, we may have to revert pixi support. We want to avoid reverting pixi support which is a community contributed feature.

If you are running into this, and it is blocking, pin the extension to a previous version.

I will be marking anything that does not directly help us address this issue as off topic. I understand the frustration, we are investigating this. Off-topic comments are not helpful to get us to resolving this issue.

@zljubisic
Copy link

@karthiknadig If you want to isolate issue, create a new python project, install pytest, write a test and try to debug it. You will see that test is not found. Maybe it will brake after some number of tests, so you have to write more than one test.
While vscode is braking, executing pytest from the shell works as expected.

@karthiknadig
Copy link
Member

@zljubisic I have tried to repro this on few repos with 70k tests. Unfortunately, I can't repro it. the hypothesis is that it seems to be related some state of the environment that makes pixi categorize it as non conda.

I have a build here where we prioritize the conda category over pixi. If this works then it means that the issue is with forming the activation commands that pixi takes over when. If this does not bypass it then we need to look further.

Try pre-release version ms-python.python.2024.15.2024092702, it requires latest VS Code insiders.

@thethiny
Copy link

thethiny commented Sep 30, 2024

@zljubisic I have tried to repro this on few repos with 70k tests. Unfortunately, I can't repro it. the hypothesis is that it seems to be related some state of the environment that makes pixi categorize it as non conda.

I have a build here where we prioritize the conda category over pixi. If this works then it means that the issue is with forming the activation commands that pixi takes over when. If this does not bypass it then we need to look further.

Try pre-release version ms-python.python.2024.15.2024092702, it requires latest VS Code insiders.

My code has no conda, has no pixi. Just main.py and tests/test_code.py

@karthiknadig
Copy link
Member

@thethiny Did you try with the ms-python.python.2024.15.2024092702 build to see what happens?

@AngelFP
Copy link

AngelFP commented Oct 1, 2024

@karthiknadig I just happened to experience this issue today. I switched to the latest prerelease version (it says v2024.17.2024100102) and now the tests are working again.

@thethiny
Copy link

thethiny commented Oct 1, 2024

@thethiny Did you try with the ms-python.python.2024.15.2024092702 build to see what happens?

I updated to the latest release and it didn't work. Then I switched python to pre-release and they're working fine.

@zljubisic
Copy link

@zljubisic I have tried to repro this on few repos with 70k tests. Unfortunately, I can't repro it. the hypothesis is that it seems to be related some state of the environment that makes pixi categorize it as non conda.

I have a build here where we prioritize the conda category over pixi. If this works then it means that the issue is with forming the activation commands that pixi takes over when. If this does not bypass it then we need to look further.

Try pre-release version ms-python.python.2024.15.2024092702, it requires latest VS Code insiders.

@karthiknadig thank you for paying attention to this issue.
Unfortunately, I can't update to VS Code insiders and also I wouldn't be happy with pre-lease version of the python extension.
I am creating virtual environments using (mini)conda. I don't know if this helps.

@anthonykim1
Copy link

@thethiny ms-python.python.2024.15.2024092702 mentioned would be the pre-release version, so I think you are getting the expected result.

Looks like #24198 helped re-prioritize conda over pixi. So people should really give a try on the latest PRE-release of the Python extension.

@anatesan-stream
Copy link

anatesan-stream commented Oct 2, 2024 via email

Copy link

github-actions bot commented Nov 2, 2024

Hey @anthonykim1, this issue might need further attention.

@adam-lagoda, you can help us out by closing this issue if the problem no longer exists, or adding more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests