You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify that a default interpreter has been selected that points to python interpreter in the .pixi\envs directory of the workspace. Its type should be Pixi.
Run the script using the play icon on top right:
The file is successfully run and prints the session info:
Open a new terminal: If you have the python.terminal.activateEnvrionment setting set to true , the environment should be activated:
You can check this by checking the location for python python -c "import sys; print(sys.prefix)”
You can also check for the CONDA_PREFIX variable or the PIXI_* variables
Test multiple environment configurations
Add another environment and install it:
pixiprojectenvironmentaddtestpixiinstall--all
Selecting the interpreter selector will now show you two environments default and the newly added test
Your old terminal should warn you that the Python extension want’s to relaunch your terminal:
Clicking the Relaunch terminal should result in a newly activated environment.
Print the value of the environment variable CONDA_PREFIX to the terminal (echo $CONDA_PREFIX using bash, echo %CONDA_PREFIX% when running Batch, or $Env:CONDA_PREFIX when using Powershell). Check that that the environment location has indeed changed to the test environment (.pixi/envs/tests):
Test with pytest
Because pixi doesn’t by default install pip the pytest installation needs to be handled by pixi .
Some of my issues are likely setup issues that should have been better spelled out here in the test plan item. Otherwise the later steps in the test plan item where easy enough to execute.
Refs: #22978
Complexity: 5
Create Issue
Requirements:
Test that Pixi environments are discovered and activated
Open a new empty workspace folder.
Open a terminal in the workspace and run the following commands to initialize a pixi project with a python interpreter:
Add an
script.py
file to the root of the workspace and open it (the contents doesnt matter).Add the following content to the
script.py
:.pixi\envs
directory of the workspace. Its type should bePixi
.python.terminal.activateEnvrionment
setting set totrue
, the environment should be activated:python
python -c "import sys; print(sys.prefix)”
CONDA_PREFIX
variable or thePIXI_*
variablesTest multiple environment configurations
default
and the newly addedtest
Python
extension want’s to relaunch your terminal:Clicking the
Relaunch terminal
should result in a newly activated environment.Print the value of the environment variable
CONDA_PREFIX
to the terminal (echo $CONDA_PREFIX
using bash,echo %CONDA_PREFIX%
when running Batch, or$Env:CONDA_PREFIX
when using Powershell). Check that that the environment location has indeed changed to thetest
environment (.pixi/envs/tests
):Test with pytest
Because
pixi
doesn’t by default installpip
thepytest
installation needs to be handled bypixi
.Add a simple test file:
test_python_testing.py
Select the testing icon:
Configure Python Tests
pytest
and the. Root directory
:pytest
for you through the terminal:Testing
tab to sync the just installed pytest with the window:Play
icons to start the tests, which should result in a failing and succeeding test:/cc @baszalmstra @tdejager
The text was updated successfully, but these errors were encountered: