Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
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
6 changes: 0 additions & 6 deletions tests/data/pixi_build/multi-output-simple/pixi.toml

This file was deleted.

34 changes: 0 additions & 34 deletions tests/data/pixi_build/multi-output-simple/recipe.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions tests/data/pixi_build/multi-output/recipe.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ version = "0.1.0"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[project.scripts]
package-a = "package_a:main"
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import subprocess

def main() -> None:
print("Pixi Build is number 1")
subprocess.run("package-b", check=True, shell=True)
70 changes: 56 additions & 14 deletions tests/integration_python/test_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_install_path_dependency(
pixi: Path, tmp_path: Path, build_data: Path, package_name: str | None, relative: bool
) -> None:
"""Test installing a pixi project from a git repository."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

Expand Down Expand Up @@ -102,7 +101,6 @@ def test_install_git_repository(
package_name: str | None,
) -> None:
"""Test installing a pixi project from a git repository."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

Expand All @@ -129,7 +127,6 @@ def test_add_git_repository_to_existing_environment(
pixi: Path, tmp_path: Path, build_data: Path, dummy_channel_1: Path
) -> None:
"""Test adding a git-based source package to an existing global environment."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

Expand Down Expand Up @@ -178,7 +175,6 @@ def test_add_git_repository_to_existing_environment(

def test_update(pixi: Path, tmp_path: Path, build_data: Path) -> None:
"""Test that pixi global update works with path dependencies."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

Expand Down Expand Up @@ -228,12 +224,11 @@ def test_install_multi_output_failing(
build_data: Path,
) -> None:
"""Test installing a pixi project from a git repository."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

# Specify the project
source_project = build_data.joinpath("multi-output-simple")
source_project = build_data.joinpath("multi-output", "recipe")

# Test install without any specs mentioned
# It should tell you which outputs are available
Expand All @@ -245,25 +240,31 @@ def test_install_multi_output_failing(
)


@pytest.mark.xfail(
reason="multi output recipes where one package depends on another doesn't work yet with pixi global"
)
def test_install_multi_output_single(
pixi: Path,
tmp_path: Path,
build_data: Path,
) -> None:
"""Test installing a pixi project from a git repository."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}
env = {
"PIXI_HOME": str(pixi_home),
}

# Specify the project
source_project = build_data.joinpath("multi-output-simple")
source_project = build_data.joinpath("multi-output", "recipe")

# Test install and explicitly requesting `foobar`
verify_cli_command([pixi, "global", "install", "--path", source_project, "foobar"], env=env)
verify_cli_command(
[pixi, "global", "install", "--path", source_project, "foobar-desktop"], env=env
)

# Check that the package was installed
foobar = pixi_home / "bin" / exec_extension("foobar")
verify_cli_command([foobar], env=env, stdout_contains="Hello from foobar")
foobar_desktop = pixi_home / "bin" / exec_extension("foobar")
verify_cli_command([foobar_desktop], env=env, stdout_contains="Hello from foobar-desktop")


def test_install_multi_output_multiple(
Expand All @@ -272,12 +273,11 @@ def test_install_multi_output_multiple(
build_data: Path,
) -> None:
"""Test installing a pixi project from a git repository."""
# Make it one level deeper so that we do no pollute git with the global
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

# Specify the project
source_project = build_data.joinpath("multi-output-simple")
source_project = build_data.joinpath("multi-output", "recipe")

# Test install and explicitly requesting `foobar` and `bizbar`
verify_cli_command(
Expand All @@ -289,3 +289,45 @@ def test_install_multi_output_multiple(
bizbar = pixi_home / "bin" / exec_extension("bizbar")
verify_cli_command([foobar], env=env, stdout_contains="Hello from foobar")
verify_cli_command([bizbar], env=env, stdout_contains="Hello from bizbar")


def test_install_recursive_source_run_dependencies(
pixi: Path,
tmp_path: Path,
build_data: Path,
) -> None:
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

# Specify the project
source_project = build_data.joinpath("recursive_source_run_dep", "package_a")

verify_cli_command([pixi, "global", "install", "--path", source_project], env=env)

# Check that package_a is exposed and works
package_a = pixi_home / "bin" / exec_extension("package-a")
verify_cli_command(
[package_a], env=env, stdout_contains=["Pixi Build is number 1", "hello from package-b"]
)

# Check that package_b is not exposed
package_b = pixi_home / "bin" / exec_extension("package-b")
assert not package_b.is_file()


def test_install_recursive_source_build_dependencies(
pixi: Path,
tmp_path: Path,
build_data: Path,
) -> None:
pixi_home = tmp_path / "pixi_home"
env = {"PIXI_HOME": str(pixi_home)}

# Specify the project
source_project = build_data.joinpath("recursive_source_build_dep", "package_a")

verify_cli_command([pixi, "global", "install", "--path", source_project], env=env)

# Check that package_a is exposed and works
package_a = pixi_home / "bin" / exec_extension("package-a")
verify_cli_command([package_a], env=env, stdout_contains=["5 + 3 = 8"])
Loading