Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: extra test for mismatch in python versions #2485

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)
Loading