Skip to content

Commit

Permalink
test: extra test for mismatch in python versions (#2485)
Browse files Browse the repository at this point in the history
This adds a test for #2481.
  • Loading branch information
tdejager authored Nov 15, 2024
1 parent 1410864 commit f0ef487
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
12 changes: 12 additions & 0 deletions tests/data/pixi_tomls/python_mismatch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
channels = ["conda-forge"]
name = "test"
platforms = ["osx-arm64", "linux-64"]

[target.linux-64.dependencies]
python = "3.12"
[target.osx-arm64.dependencies]
python = "3.13"

[pypi-dependencies]
finch-mlir = "==0.0.2"
38 changes: 38 additions & 0 deletions tests/integration_python/test_edge_cases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from pathlib import Path
import pytest
import platform
from .common import verify_cli_command, ExitCode


@pytest.mark.slow
def test_pypi_git_deps(pixi: Path, tmp_path: Path) -> None:
"""Test where we need to lookup recursive git dependencies and consider them first party"""
test_data = Path(__file__).parent.parent / "data/pixi_tomls/pip_git_dep.toml"
manifest = tmp_path.joinpath("pixi.toml")
toml = test_data.read_text()
manifest.write_text(toml)

# Run the installation
verify_cli_command(
[pixi, "install", "--manifest-path", manifest],
ExitCode.SUCCESS,
)


@pytest.mark.slow
@pytest.mark.skipif(
not (platform.system() == "Darwin" and platform.machine() == "arm64"),
reason="Test tailored for macOS arm so that we can get two different python interpreters",
)
def test_python_mismatch(pixi: Path, tmp_path: Path) -> None:
"""Test pypi wheel install where the base interpreter is not the same as the target version"""
test_data = Path(__file__).parent.parent / "data/pixi_tomls/python_mismatch.toml"
manifest = tmp_path.joinpath("pixi.toml")
toml = test_data.read_text()
manifest.write_text(toml)

# Install
verify_cli_command(
[pixi, "install", "--manifest-path", manifest],
ExitCode.SUCCESS,
)
15 changes: 0 additions & 15 deletions tests/integration_python/test_run_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pathlib import Path
import pytest
from .common import verify_cli_command, ExitCode, default_env_path

ALL_PLATFORMS = '["linux-64", "osx-64", "win-64", "linux-ppc64le", "linux-aarch64"]'
Expand Down Expand Up @@ -154,17 +153,3 @@ def test_prefix_revalidation(pixi: Path, tmp_path: Path, dummy_channel_1: str) -
# Validate that the dummy-a files are reinstalled
for file in dummy_a_meta_files:
assert Path(file).exists()


@pytest.mark.slow
def test_pypi_git_deps(pixi: Path, tmp_path: Path) -> None:
test_data = Path(__file__).parent.parent / "data/pixi_tomls/pip_git_dep.toml"
manifest = tmp_path.joinpath("pixi.toml")
toml = test_data.read_text()
manifest.write_text(toml)

# Run the installation
verify_cli_command(
[pixi, "install", "--manifest-path", manifest],
ExitCode.SUCCESS,
)

0 comments on commit f0ef487

Please sign in to comment.