File tree Expand file tree Collapse file tree 5 files changed +54
-0
lines changed
spyder_kernels/utils/tests Expand file tree Collapse file tree 5 files changed +54
-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 : Create environment with Pixi
50+ shell : bash -l {0}
51+ run : |
52+ curl -fsSL https://pixi.sh/install.sh | sh
53+ cd ~
54+ pixi init pixi-test
55+ cd pixi-test
56+ pixi add python
4957 - name : Show environment information
5058 shell : bash -l {0}
5159 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 : Create environment with Pixi
57+ shell : bash -l {0}
58+ run : |
59+ curl -fsSL https://pixi.sh/install.sh | sh
60+ cd ~
61+ pixi init pixi-test
62+ cd pixi-test
63+ pixi add python
5664 - name : Show environment information
5765 shell : bash -l {0}
5866 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 : Create environment with Pixi
53+ shell : bash -l {0}
54+ run : |
55+ curl -fsSL https://pixi.sh/install.sh | sh
56+ cd ~
57+ pixi init pixi-test
58+ cd pixi-test
59+ pixi add python
5260 - name : Show environment information
5361 shell : bash -l {0}
5462 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 : Create environment with Pixi
53+ shell : bash -l {0}
54+ run : |
55+ curl -fsSL https://pixi.sh/install.sh | sh
56+ cd ~
57+ pixi init pixi-test
58+ cd pixi-test
59+ pixi add python
5260 - name : Show environment information
5361 shell : bash -l {0}
5462 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,24 @@ def test_get_env_dir():
6265 assert output == "foobar"
6366
6467
68+ @pytest .mark .skipif (
69+ not (shutil .which ("pixi" ) and os .environ .get ("CI" )),
70+ reason = "Only works with Pixi on CIs"
71+ )
72+ def get_pixi_info ():
73+ home_dir = Path (os .environ ["HOME" ])
74+ pixi_env_dir = home_dir / "pixi-test" / ".pixi" / "envs" / "default"
75+
76+ pixi_env_info = get_pixi_manifest_path_and_env_name (
77+ str (pixi_env_dir / "python.exe" )
78+ if os .name == "nt"
79+ else str (pixi_env_dir / "bin" / "python" )
80+ )
81+
82+ assert pixi_env_info == (
83+ str (home_dir / "pixi-test" / "pixi.toml" ), "default"
84+ )
85+
86+
6587if __name__ == "__main__" :
6688 pytest .main ()
You can’t perform that action at this time.
0 commit comments