Skip to content

Commit 3e7358a

Browse files
committed
fix integration test
1 parent a98a259 commit 3e7358a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/integration_python/test_main_cli.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import shutil
44
import sys
55
import tomllib
6+
import tomli_w
67
from pathlib import Path
78

89
import pytest
@@ -1191,6 +1192,55 @@ def test_frozen_no_install_invariant(pixi: Path, tmp_pixi_workspace: Path) -> No
11911192
# Add bzip2 package to keep installation time low
11921193
verify_cli_command([pixi, "add", "--manifest-path", manifest_path, "bzip2"])
11931194

1195+
recipe_path = tmp_pixi_workspace / "recipe.yaml"
1196+
recipe_path.write_text(
1197+
"""recipe:
1198+
name: frozen_no_install_build
1199+
version: "0.1.0"
1200+
1201+
outputs:
1202+
- package:
1203+
name: frozen_no_install_build
1204+
build:
1205+
script:
1206+
- if: win
1207+
then:
1208+
- mkdir -p %PREFIX%\\bin
1209+
- echo @echo off > %PREFIX%\\bin\\frozen_no_install_build.bat
1210+
- echo echo Hello from frozen_no_install_build >> %PREFIX%\\bin\\frozen_no_install_build.bat
1211+
else:
1212+
- mkdir -p $PREFIX/bin
1213+
- echo "#!/usr/bin/env bash" > $PREFIX/bin/frozen_no_install_build
1214+
- echo "echo Hello from frozen_no_install_build" >> $PREFIX/bin/frozen_no_install_build
1215+
- chmod +x $PREFIX/bin/frozen_no_install_build
1216+
"""
1217+
)
1218+
1219+
manifest_data = tomllib.loads(manifest_path.read_text())
1220+
workspace_table = manifest_data.setdefault("workspace", {})
1221+
preview_list = workspace_table.setdefault("preview", [])
1222+
if "pixi-build" not in preview_list:
1223+
preview_list.append("pixi-build")
1224+
1225+
dependencies = manifest_data.setdefault("dependencies", {})
1226+
dependencies.pop("frozen_no_install_build", None)
1227+
1228+
package_table = manifest_data.setdefault("package", {})
1229+
package_table["name"] = "frozen_no_install_build"
1230+
package_table["version"] = "0.1.0"
1231+
build_table = package_table.setdefault("build", {})
1232+
backend_table = build_table.setdefault("backend", {})
1233+
backend_table["name"] = "pixi-build-rattler-build"
1234+
backend_table["version"] = "*"
1235+
backend_table["channels"] = [
1236+
"https://prefix.dev/pixi-build-backends",
1237+
"https://prefix.dev/conda-forge",
1238+
]
1239+
1240+
manifest_path.write_text(tomli_w.dumps(manifest_data))
1241+
1242+
verify_cli_command([pixi, "lock", "--manifest-path", manifest_path])
1243+
11941244
# Create a simple environment.yml file for import testing
11951245
simple_env_yml = tmp_pixi_workspace / "simple_env.yml"
11961246
simple_env_yml.write_text("""name: simple-env
@@ -1250,6 +1300,8 @@ def check_invariants(command_name: str) -> None:
12501300
),
12511301
# Upgrade commands
12521302
(["upgrade"], [], "pixi upgrade"),
1303+
# Pixi build (can lock its source)
1304+
(["build"], [], "pixi build"),
12531305
]
12541306
# This command needs to stay last so we always have something that requires a re-solve
12551307
# Dont move this!

0 commit comments

Comments
 (0)