diff --git a/tests/recipes-v2/python_variants/build.sh b/tests/recipes-v2/python_variants/build.sh new file mode 100644 index 00000000..1070cc32 --- /dev/null +++ b/tests/recipes-v2/python_variants/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +TEST_FILE="data/test.py" + +if [[ ! -f $TEST_FILE ]] ; then + echo "data/test.py is missing" + ls -al + exit 1 +else + install $TEST_FILE $PREFIX/bin +fi diff --git a/tests/recipes-v2/python_variants/conda_build_config.yaml b/tests/recipes-v2/python_variants/conda_build_config.yaml new file mode 100644 index 00000000..66accbad --- /dev/null +++ b/tests/recipes-v2/python_variants/conda_build_config.yaml @@ -0,0 +1,3 @@ +python: + - 3.9 + - 3.10 diff --git a/tests/recipes-v2/python_variants/data/test.py b/tests/recipes-v2/python_variants/data/test.py new file mode 100755 index 00000000..367fec58 --- /dev/null +++ b/tests/recipes-v2/python_variants/data/test.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python + +print("Hello") diff --git a/tests/recipes-v2/python_variants/recipe.yaml b/tests/recipes-v2/python_variants/recipe.yaml new file mode 100644 index 00000000..a464da10 --- /dev/null +++ b/tests/recipes-v2/python_variants/recipe.yaml @@ -0,0 +1,20 @@ +context: + name: test_simple_variants + version: 0.0.0 + +package: + name: '{{ name|lower }}' + version: '{{ version }}' + +source: + - path: data + folder: data + +requirements: + host: + - python + run: + - python + +build: + number: 0 diff --git a/tests/recipes-v2/python_variants/run_test.sh b/tests/recipes-v2/python_variants/run_test.sh new file mode 100644 index 00000000..174c27b1 --- /dev/null +++ b/tests/recipes-v2/python_variants/run_test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +test.py diff --git a/tests/test_boa_build.py b/tests/test_boa_build.py index 97b7a3f4..5655c5c8 100644 --- a/tests/test_boa_build.py +++ b/tests/test_boa_build.py @@ -76,3 +76,9 @@ def test_build_with_script_env(tmp_path: Path): assert key1 == "KEY1_RANDOM_VALUE" key2 = fin.extractfile("key2.txt").read().decode("utf8").strip() assert key2 == "JUST A VALUE" + + +def test_build_variant(): + recipe = recipes_dir / "python_variants" + variant_file = recipe / "conda_build_config.yaml" + check_call(["boa", "build", "-m", variant_file, recipe])