File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed
spyder_kernels/utils/tests Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 4646 shell : bash -l {0}
4747 run : |
4848 pip install -e .[test]
49+ - name : Install Pixi
50+ uses :
prefix-dev/[email protected] 51+ with :
52+ run-install : false
53+ - name : Create environment with Pixi
54+ shell : bash -l {0}
55+ run : |
56+ cd ~
57+ pixi init pixi-test
58+ cd pixi-test
59+ pixi add python
4960 - name : Show environment information
5061 shell : bash -l {0}
5162 run : |
Original file line number Diff line number Diff line change 5353 - name : Install Package
5454 shell : bash -l {0}
5555 run : pip install -e .
56+ - name : Install Pixi
57+ uses :
prefix-dev/[email protected] 58+ with :
59+ run-install : false
60+ - name : Create environment with Pixi
61+ shell : bash -l {0}
62+ run : |
63+ cd ~
64+ pixi init pixi-test
65+ cd pixi-test
66+ pixi add python
5667 - name : Show environment information
5768 shell : bash -l {0}
5869 run : |
Original file line number Diff line number Diff line change 4949 - name : Install Package
5050 shell : bash -l {0}
5151 run : pip install -e .
52+ - name : Install Pixi
53+ uses :
prefix-dev/[email protected] 54+ with :
55+ run-install : false
56+ - name : Create environment with Pixi
57+ shell : bash -l {0}
58+ run : |
59+ cd ~
60+ pixi init pixi-test
61+ cd pixi-test
62+ pixi add python
5263 - name : Show environment information
5364 shell : bash -l {0}
5465 run : |
Original file line number Diff line number Diff line change 4949 - name : Install Package
5050 shell : bash -l {0}
5151 run : pip install -e .
52+ - name : Install Pixi
53+ uses :
prefix-dev/[email protected] 54+ with :
55+ run-install : false
56+ - name : Create environment with Pixi
57+ shell : bash -l {0}
58+ run : |
59+ cd ~
60+ pixi init pixi-test
61+ cd pixi-test
62+ pixi add python
5263 - name : Show environment information
5364 shell : bash -l {0}
5465 run : |
Original file line number Diff line number Diff line change 1212
1313# Standard library imports
1414import os
15+ from pathlib import Path
16+ import shutil
1517
1618# Third-party imports
1719import pytest
2123 add_quotes ,
2224 get_conda_env_path ,
2325 get_env_dir ,
26+ get_pixi_manifest_path_and_env_name ,
2427)
2528
2629
@@ -62,5 +65,26 @@ def test_get_env_dir():
6265 assert output == "foobar"
6366
6467
68+ @pytest .mark .skipif (
69+ not (
70+ shutil .which ("pixi.exe" if os .name == "nt" else "pixi" )
71+ and os .environ .get ("CI" )
72+ ),
73+ reason = "Only works with Pixi on CIs" ,
74+ )
75+ def test_get_pixi_info ():
76+ home_path = Path (os .environ ["HOME" ])
77+ pixi_env_dir = home_path / "pixi-test" / ".pixi" / "envs" / "default"
78+ pixi_env_info = get_pixi_manifest_path_and_env_name (
79+ str (pixi_env_dir / "python.exe" )
80+ if os .name == "nt"
81+ else str (pixi_env_dir / "bin" / "python" )
82+ )
83+
84+ assert pixi_env_info == (
85+ str (home_path / "pixi-test" / "pixi.toml" ), "default"
86+ )
87+
88+
6589if __name__ == "__main__" :
6690 pytest .main ()
You can’t perform that action at this time.
0 commit comments