File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed
spyder_kernels/utils/tests Expand file tree Collapse file tree 5 files changed +55
-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/bin/pixi init pixi-test
55+ cd pixi-test
56+ ~/.pixi/bin/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/bin/pixi init pixi-test
62+ cd pixi-test
63+ ~/.pixi/bin/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/bin/pixi init pixi-test
58+ cd pixi-test
59+ ~/.pixi/bin/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/bin/pixi init pixi-test
58+ cd pixi-test
59+ ~/.pixi/bin/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,25 @@ def test_get_env_dir():
6265 assert output == "foobar"
6366
6467
68+ @pytest .mark .skipif (not os .environ .get ("CI" ), reason = "Only works on CIs" )
69+ def test_get_pixi_info ():
70+ home_path = Path (os .environ ["HOME" ])
71+
72+ # Skip if pixi is not available
73+ #if not os.path.isfile(home_path / ".pixi" / "bin" / "pixi"):
74+ # return
75+
76+ pixi_env_dir = home_path / "pixi-test" / ".pixi" / "envs" / "default"
77+ pixi_env_info = get_pixi_manifest_path_and_env_name (
78+ str (pixi_env_dir / "python.exe" )
79+ if os .name == "nt"
80+ else str (pixi_env_dir / "bin" / "python" )
81+ )
82+
83+ assert pixi_env_info == (
84+ str (home_path / "pixi-test" / "pixi.toml" ), "default"
85+ )
86+
87+
6588if __name__ == "__main__" :
6689 pytest .main ()
You can’t perform that action at this time.
0 commit comments