diff --git a/conda_forge_tick/migrators/arch.py b/conda_forge_tick/migrators/arch.py index 528b860a9..a3a624e66 100644 --- a/conda_forge_tick/migrators/arch.py +++ b/conda_forge_tick/migrators/arch.py @@ -1,4 +1,5 @@ import copy +import os from textwrap import dedent from typing import Any, Collection, Literal, Optional, Sequence @@ -68,6 +69,7 @@ def _filter_stubby_and_ignored_nodes(graph, ignored_packages): class ArchRebuild(GraphMigrator): """A Migrator that adds aarch64 and ppc64le builds to feedstocks.""" + allowed_schema_versions = {0, 1} migrator_version = 1 rerender = True # We purposefully don't want to bump build number for this migrator @@ -155,7 +157,10 @@ def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any ) -> MigrationUidTypedDict | Literal[False]: with pushd(recipe_dir + "/.."): - self.set_build_number("recipe/meta.yaml") + recipe_file = next( + filter(os.path.exists, ("recipe/recipe.yaml", "recipe/meta.yaml")) + ) + self.set_build_number(recipe_file) with open("conda-forge.yml") as f: y = yaml_safe_load(f) @@ -311,7 +316,10 @@ def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any ) -> MigrationUidTypedDict | Literal[False]: with pushd(recipe_dir + "/.."): - self.set_build_number("recipe/meta.yaml") + recipe_file = next( + filter(os.path.exists, ("recipe/recipe.yaml", "recipe/meta.yaml")) + ) + self.set_build_number(recipe_file) with open("conda-forge.yml") as f: y = yaml_safe_load(f) @@ -344,6 +352,7 @@ def migrate( class OSXArm(_CrossCompileRebuild): """A Migrator that adds osx-arm64 builds to feedstocks.""" + allowed_schema_versions = {0, 1} migrator_version = 1 build_platform = {"osx_arm64": "osx_64"} pkg_list_filename = "osx_arm64.txt" @@ -378,6 +387,7 @@ def remote_branch(self, feedstock_ctx: FeedstockContext) -> str: class WinArm64(_CrossCompileRebuild): """A Migrator that adds win-arm64 builds to feedstocks.""" + allowed_schema_versions = {0, 1} migrator_version = 1 build_platform = {"win_arm64": "win_64"} pkg_list_filename = "win_arm64.txt" diff --git a/conda_forge_tick/migrators/cross_compile.py b/conda_forge_tick/migrators/cross_compile.py index b63769c94..b6e50960b 100644 --- a/conda_forge_tick/migrators/cross_compile.py +++ b/conda_forge_tick/migrators/cross_compile.py @@ -34,6 +34,8 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: class UpdateConfigSubGuessMigrator(CrossCompilationMigratorBase): + allowed_schema_versions = {0, 1} + def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: if ( attrs["feedstock_name"] == "libtool" @@ -97,22 +99,40 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No with open("build.sh", "w") as f: f.write("".join(lines)) - with open("meta.yaml") as f: + recipe_file = next( + filter(os.path.exists, ("recipe.yaml", "meta.yaml")) + ) + with open(recipe_file) as f: lines = f.readlines() for i, line in enumerate(lines): - if line.strip().startswith("- {{ compiler"): + if recipe_file == "meta.yaml" and line.strip().startswith( + "- {{ compiler" + ): new_line = " " * (len(line) - len(line.lstrip())) new_line += "- gnuconfig # [unix]\n" lines.insert(i, new_line) break - with open("meta.yaml", "w") as f: + if recipe_file == "recipe.yaml" and line.strip().startswith( + "- ${{ compiler" + ): + new_line = " " * (len(line) - len(line.lstrip())) + new_line += "- if: unix\n" + lines.insert(i, new_line) + new_line = " " * (len(line) - len(line.lstrip())) + new_line += " then: gnuconfig\n" + lines.insert(i + 1, new_line) + break + + with open(recipe_file, "w") as f: f.write("".join(lines)) except RuntimeError: return class GuardTestingMigrator(CrossCompilationMigratorBase): + allowed_schema_versions = {0, 1} + def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): if not os.path.exists("build.sh"): @@ -149,35 +169,41 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No class GuardTestingWinMigrator(CrossCompilationMigratorBase): + allowed_schema_versions = {0, 1} + def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): - if not os.path.exists("bld.bat"): - return - with open("bld.bat") as f: - lines = list(f.readlines()) + for batch_file in ("bld.bat", "build.bat"): + if not os.path.exists(batch_file): + continue + with open(batch_file) as f: + lines = list(f.readlines()) - for i, line in enumerate(lines): - if "CONDA_BUILD_CROSS_COMPILATION" in line: - return - if ( - line.strip().startswith("make check") - or line.strip().startswith("ctest") - or line.strip().startswith("make test") - ): - lines.insert(i, 'if not "%CONDA_BUILD_SKIP_TESTS%"=="1" (\n') - insert_after = i + 1 - while len(lines) > insert_after and lines[insert_after].endswith( - "\\\n", + for i, line in enumerate(lines): + if "CONDA_BUILD_CROSS_COMPILATION" in line: + return + if ( + line.strip().startswith("make check") + or line.strip().startswith("ctest") + or line.strip().startswith("make test") ): - insert_after += 1 - if lines[insert_after][-1] != "\n": - lines[insert_after] += "\n" - lines.insert(insert_after + 1, ")\n") - break - else: - return - with open("bld.bat", "w") as f: - f.write("".join(lines)) + lines.insert(i, 'if not "%CONDA_BUILD_SKIP_TESTS%"=="1" (\n') + insert_after = i + 1 + while len(lines) > insert_after and lines[ + insert_after + ].endswith( + "\\\n", + ): + insert_after += 1 + if lines[insert_after][-1] != "\n": + lines[insert_after] += "\n" + lines.insert(insert_after + 1, ")\n") + break + else: + return + with open(batch_file, "w") as f: + f.write("".join(lines)) + break class CrossPythonMigrator(MiniMigrator): @@ -265,6 +291,8 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No class UpdateCMakeArgsMigrator(CrossCompilationMigratorBase): + allowed_schema_versions = {0, 1} + def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: build_reqs = attrs.get("requirements", {}).get("build", set()) return "cmake" not in build_reqs or skip_migrator_due_to_schema( @@ -294,6 +322,8 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No class UpdateCMakeArgsWinMigrator(CrossCompilationMigratorBase): + allowed_schema_versions = {0, 1} + def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: build_reqs = attrs.get("requirements", {}).get("build", set()) return "cmake" not in build_reqs or skip_migrator_due_to_schema( @@ -302,24 +332,26 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): - if not os.path.exists("bld.bat"): - return - with open("bld.bat") as f: - lines = list(f.readlines()) + for batch_file in ("bld.bat", "build.bat"): + if not os.path.exists(batch_file): + continue + with open(batch_file) as f: + lines = list(f.readlines()) - for i, line in enumerate(lines): - if "%CMAKE_ARGS%" in line: - return + for i, line in enumerate(lines): + if "%CMAKE_ARGS%" in line: + return - for i, line in enumerate(lines): - if line.startswith("cmake "): - lines[i] = "cmake %CMAKE_ARGS% " + line[len("cmake ") :] - break - else: - return + for i, line in enumerate(lines): + if line.startswith("cmake "): + lines[i] = "cmake %CMAKE_ARGS% " + line[len("cmake ") :] + break + else: + return - with open("bld.bat", "w") as f: - f.write("".join(lines)) + with open(batch_file, "w") as f: + f.write("".join(lines)) + break class Build2HostMigrator(MiniMigrator): @@ -374,6 +406,7 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No class NoCondaInspectMigrator(MiniMigrator): + allowed_schema_versions = {0, 1} post_migration = True def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: @@ -385,7 +418,8 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> None: with pushd(recipe_dir): - with open("meta.yaml") as fp: + recipe_file = next(filter(os.path.exists, ("recipe.yaml", "meta.yaml"))) + with open(recipe_file) as fp: meta_yaml = fp.readlines() new_lines = [] @@ -394,7 +428,7 @@ def migrate(self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any) -> No continue new_lines.append(line) - with open("meta.yaml", "w") as f: + with open(recipe_file, "w") as f: f.write("".join(new_lines)) diff --git a/conda_forge_tick/migrators/mpi_pin_run_as_build.py b/conda_forge_tick/migrators/mpi_pin_run_as_build.py index 14f256fbb..9942d4bb4 100644 --- a/conda_forge_tick/migrators/mpi_pin_run_as_build.py +++ b/conda_forge_tick/migrators/mpi_pin_run_as_build.py @@ -74,6 +74,8 @@ def _parse_cbc_mpi(lines): class MPIPinRunAsBuildCleanup(MiniMigrator): + allowed_schema_versions = {0, 1} + def filter(self, attrs, not_bad_str_start=""): host_req = (attrs.get("requirements", {}) or {}).get("host", set()) or set() diff --git a/conda_forge_tick/provide_source_code.py b/conda_forge_tick/provide_source_code.py index 0bf270c6c..9976fca3c 100644 --- a/conda_forge_tick/provide_source_code.py +++ b/conda_forge_tick/provide_source_code.py @@ -1,12 +1,15 @@ import glob +import json import logging import os import shutil +import subprocess import sys import tempfile from contextlib import contextmanager import wurlitzer +import yaml from conda_forge_feedstock_ops.container_utils import ( get_default_log_level_args, run_container_operation, @@ -149,38 +152,90 @@ def _print_out(): try: with wurlitzer.pipes(stderr=wurlitzer.STDOUT) as (out, _): - from conda_build.api import render - from conda_build.config import get_or_merge_config - from conda_build.source import provide - - # Use conda build to do all the downloading/extracting bits - config = get_or_merge_config(None) ci_support_files = sorted( glob.glob(os.path.join(recipe_dir, "../.ci_support/*.yaml")) ) if ci_support_files: - config.variant_config_files = [ci_support_files[0]] + variant_config_file = ci_support_files[0] else: - config.variant_config_files = [ - # try global pinnings - os.path.join(os.environ["CONDA_PREFIX"], "conda_build_config.yaml") - ] - - md = render( - recipe_dir, - config=config, - finalize=False, - bypass_env_check=True, - ) - if not md: - return None - md = md[0][0] + # try global pinnings + variant_config_file = os.path.join( + os.environ["CONDA_PREFIX"], "conda_build_config.yaml" + ) + if os.path.exists(os.path.join(recipe_dir, "recipe.yaml")): + result = _provide_source_code_v1(recipe_dir, variant_config_file) + if result is not None: + yield result + else: + from conda_build.api import render + from conda_build.config import get_or_merge_config + from conda_build.source import provide + + # Use conda build to do all the downloading/extracting bits + config = get_or_merge_config(None) + config.variant_config_files = [variant_config_file] + md = render( + recipe_dir, + config=config, + finalize=False, + bypass_env_check=True, + ) + if not md: + return None + md = md[0][0] + + yield provide(md) - # provide source dir - yield provide(md) except (SystemExit, Exception) as e: _print_out() logger.error("Error in getting conda build src!", exc_info=e) raise RuntimeError("conda build src exception: " + str(e)) _print_out() + + +def _provide_source_code_v1(recipe_dir, variant_config_file): + recipe_json = subprocess.check_output( + [ + "rattler-build", + "build", + "--render-only", + "-r", + f"{recipe_dir}/recipe.yaml", + "-m", + variant_config_file, + ] + ) + recipe_meta = json.loads(recipe_json)[0] + recipe = recipe_meta["recipe"] + minimal_recipe = { + "context": recipe.get("context", {}), + "package": recipe.get("package", {}), + "source": recipe["source"], + "build": { + "script": { + "content": "exit 1", + }, + }, + } + with open(f"{recipe_dir}/minimal_recipe.yaml", "w") as f: + yaml.dump(minimal_recipe, f) + try: + out = subprocess.run( + [ + "rattler-build", + "build", + "-r", + f"{recipe_dir}/minimal_recipe.yaml", + "-m", + variant_config_file, + ], + check=False, + capture_output=True, + ) + for line in out.stderr.decode("utf-8").splitlines(): + text_to_search = "Work directory: " + if text_to_search in line: + return line[(line.index(text_to_search) + len(text_to_search)) :] + finally: + os.remove(f"{recipe_dir}/minimal_recipe.yaml") diff --git a/tests/test_cross_compile.py b/tests/test_cross_compile.py index 4f333c51b..0e90ed6f6 100644 --- a/tests/test_cross_compile.py +++ b/tests/test_cross_compile.py @@ -88,14 +88,17 @@ ) -def test_correct_config_sub(tmp_path): +@pytest.mark.parametrize("recipe_version", [0, 1]) +def test_correct_config_sub(tmp_path, recipe_version: int): tmp_path.joinpath("recipe").mkdir() with open(tmp_path / "recipe/build.sh", "w") as f: f.write("#!/bin/bash\n./configure") run_test_migration( m=version_migrator_autoconf, - inp=YAML_PATH.joinpath("config_recipe.yaml").read_text(), - output=YAML_PATH.joinpath("config_recipe_correct.yaml").read_text(), + inp=YAML_PATHS[recipe_version].joinpath("config_recipe.yaml").read_text(), + output=YAML_PATHS[recipe_version] + .joinpath("config_recipe_correct.yaml") + .read_text(), prb="Dependencies have been updated if changed", kwargs={"new_version": "4.5.0"}, mr_out={ @@ -104,19 +107,23 @@ def test_correct_config_sub(tmp_path): "version": "4.5.0", }, tmp_path=tmp_path, + recipe_version=recipe_version, ) with open(tmp_path / "recipe/build.sh") as f: assert len(f.readlines()) == 4 -def test_make_check(tmp_path): +@pytest.mark.parametrize("recipe_version", [0, 1]) +def test_make_check(tmp_path, recipe_version: int): tmp_path.joinpath("recipe").mkdir() with open(tmp_path / "recipe/build.sh", "w") as f: f.write("#!/bin/bash\nmake check") run_test_migration( m=version_migrator_autoconf, - inp=YAML_PATH.joinpath("config_recipe.yaml").read_text(), - output=YAML_PATH.joinpath("config_recipe_correct_make_check.yaml").read_text(), + inp=YAML_PATHS[recipe_version].joinpath("config_recipe.yaml").read_text(), + output=YAML_PATHS[recipe_version] + .joinpath("config_recipe_correct_make_check.yaml") + .read_text(), prb="Dependencies have been updated if changed", kwargs={"new_version": "4.5.0"}, mr_out={ @@ -125,6 +132,7 @@ def test_make_check(tmp_path): "version": "4.5.0", }, tmp_path=tmp_path, + recipe_version=recipe_version, ) expected = [ "#!/bin/bash\n", @@ -139,16 +147,20 @@ def test_make_check(tmp_path): assert lines == expected -def test_cmake(tmp_path): +@pytest.mark.parametrize("recipe_version", [0, 1]) +def test_cmake(tmp_path, recipe_version: int): tmp_path.joinpath("recipe").mkdir() + bld_bat = "bld.bat" if recipe_version == 0 else "build.bat" with open(tmp_path / "recipe/build.sh", "w") as f: f.write("#!/bin/bash\ncmake ..\nctest") - with open(tmp_path / "recipe/bld.bat", "w") as f: + with open(tmp_path / f"recipe/{bld_bat}", "w") as f: f.write("cmake ..\nctest") run_test_migration( m=version_migrator_cmake, - inp=YAML_PATH.joinpath("config_recipe.yaml").read_text(), - output=YAML_PATH.joinpath("config_recipe_correct_cmake.yaml").read_text(), + inp=YAML_PATHS[recipe_version].joinpath("config_recipe.yaml").read_text(), + output=YAML_PATHS[recipe_version] + .joinpath("config_recipe_correct_cmake.yaml") + .read_text(), prb="Dependencies have been updated if changed", kwargs={"new_version": "4.5.0"}, mr_out={ @@ -157,6 +169,7 @@ def test_cmake(tmp_path): "version": "4.5.0", }, tmp_path=tmp_path, + recipe_version=recipe_version, ) expected_unix = [ "#!/bin/bash\n", @@ -174,7 +187,7 @@ def test_cmake(tmp_path): with open(tmp_path / "recipe/build.sh") as f: lines = f.readlines() assert lines == expected_unix - with open(tmp_path / "recipe/bld.bat") as f: + with open(tmp_path / f"recipe/{bld_bat}") as f: lines = f.readlines() assert lines == expected_win @@ -339,11 +352,14 @@ def test_build2host_bhskip(recipe_version, tmp_path): ) -def test_nocondainspect(tmp_path): +@pytest.mark.parametrize("recipe_version", [0, 1]) +def test_nocondainspect(tmp_path, recipe_version: int): run_test_migration( m=version_migrator_nci, - inp=YAML_PATH.joinpath("python_recipe_nci.yaml").read_text(), - output=YAML_PATH.joinpath("python_recipe_nci_correct.yaml").read_text(), + inp=YAML_PATHS[recipe_version].joinpath("python_recipe_nci.yaml").read_text(), + output=YAML_PATHS[recipe_version] + .joinpath("python_recipe_nci_correct.yaml") + .read_text(), prb="Dependencies have been updated if changed", kwargs={"new_version": "1.19.1"}, mr_out={ @@ -352,6 +368,7 @@ def test_nocondainspect(tmp_path): "version": "1.19.1", }, tmp_path=tmp_path, + recipe_version=recipe_version, ) diff --git a/tests/test_v1_yaml/cross_compile/config_recipe.yaml b/tests/test_v1_yaml/cross_compile/config_recipe.yaml new file mode 100644 index 000000000..fbc85458b --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/config_recipe.yaml @@ -0,0 +1,39 @@ +schema_version: 1 + +context: + version: 4.4.1 + +package: + name: readline + version: ${{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-${{ version }}.tar.gz + sha256: 750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 + +build: + number: 2 + skip: win + +requirements: + build: + - pkg-config + - ${{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + run_exports: + - ${{ pin_subpackage('readline') }} + +about: + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + homepage: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + +extra: + recipe-maintainers: + - croth1 diff --git a/tests/test_v1_yaml/cross_compile/config_recipe_correct.yaml b/tests/test_v1_yaml/cross_compile/config_recipe_correct.yaml new file mode 100644 index 000000000..f95eebe29 --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/config_recipe_correct.yaml @@ -0,0 +1,41 @@ +schema_version: 1 + +context: + version: "4.5.0" + +package: + name: readline + version: ${{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-${{ version }}.tar.gz + sha256: 93db9e519efe372657d97e96e68c888aa65696b0ee31408780efa6388563989b + +build: + number: 0 + skip: win + +requirements: + build: + - pkg-config + - if: unix + then: gnuconfig + - ${{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + run_exports: + - ${{ pin_subpackage('readline') }} + +about: + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + homepage: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + +extra: + recipe-maintainers: + - croth1 diff --git a/tests/test_v1_yaml/cross_compile/config_recipe_correct_cmake.yaml b/tests/test_v1_yaml/cross_compile/config_recipe_correct_cmake.yaml new file mode 100644 index 000000000..f0ce8c5e6 --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/config_recipe_correct_cmake.yaml @@ -0,0 +1,39 @@ +schema_version: 1 + +context: + version: "4.5.0" + +package: + name: readline + version: ${{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-${{ version }}.tar.gz + sha256: 93db9e519efe372657d97e96e68c888aa65696b0ee31408780efa6388563989b + +build: + number: 0 + skip: win + +requirements: + build: + - pkg-config + - ${{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + run_exports: + - ${{ pin_subpackage('readline') }} + +about: + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + homepage: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + +extra: + recipe-maintainers: + - croth1 diff --git a/tests/test_v1_yaml/cross_compile/config_recipe_correct_make_check.yaml b/tests/test_v1_yaml/cross_compile/config_recipe_correct_make_check.yaml new file mode 100644 index 000000000..f95eebe29 --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/config_recipe_correct_make_check.yaml @@ -0,0 +1,41 @@ +schema_version: 1 + +context: + version: "4.5.0" + +package: + name: readline + version: ${{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-${{ version }}.tar.gz + sha256: 93db9e519efe372657d97e96e68c888aa65696b0ee31408780efa6388563989b + +build: + number: 0 + skip: win + +requirements: + build: + - pkg-config + - if: unix + then: gnuconfig + - ${{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + run_exports: + - ${{ pin_subpackage('readline') }} + +about: + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + homepage: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + +extra: + recipe-maintainers: + - croth1 diff --git a/tests/test_v1_yaml/cross_compile/python_recipe_nci.yaml b/tests/test_v1_yaml/cross_compile/python_recipe_nci.yaml new file mode 100644 index 000000000..1f5afdba6 --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/python_recipe_nci.yaml @@ -0,0 +1,66 @@ +schema_version: 1 + +context: + version: 1.19.0 + +package: + name: numpy + version: ${{ version }} + +source: + url: https://github.com/numpy/numpy/releases/download/v${{ version }}/numpy-${{ version }}.tar.gz + sha256: 153cf8b0176e57a611931981acfe093d2f7fef623b48f91176efa199798a6b90 + +build: + number: 0 + python: + entry_points: + - if: win + then: f2py = numpy.f2py.f2py2e:main + +requirements: + host: + - python + - pip + - cython + - libblas + - libcblas + - liblapack + run: + - python + +tests: + - python: + imports: + - numpy + - numpy.linalg.lapack_lite + pip_check: false + - requirements: + run: + - pytest + - hypothesis + script: + - f2py -h + - if: unix + then: export OPENBLAS_NUM_THREADS=1 + - if: win + then: set OPENBLAS_NUM_THREADS=1 + - conda inspect linkages + - conda inspect objects + - conda inspect cars + +about: + license: BSD-3-Clause + license_file: LICENSE.txt + summary: Array processing for numbers, strings, records, and objects. + homepage: http://numpy.scipy.org/ + repository: https://github.com/numpy/numpy + documentation: https://docs.scipy.org/doc/numpy/reference/ + +extra: + recipe-maintainers: + - jakirkham + - msarahan + - pelson + - rgommers + - ocefpaf diff --git a/tests/test_v1_yaml/cross_compile/python_recipe_nci_correct.yaml b/tests/test_v1_yaml/cross_compile/python_recipe_nci_correct.yaml new file mode 100644 index 000000000..517e5ccfa --- /dev/null +++ b/tests/test_v1_yaml/cross_compile/python_recipe_nci_correct.yaml @@ -0,0 +1,63 @@ +schema_version: 1 + +context: + version: "1.19.1" + +package: + name: numpy + version: ${{ version }} + +source: + url: https://github.com/numpy/numpy/releases/download/v${{ version }}/numpy-${{ version }}.tar.gz + sha256: 1396e6c3d20cbfc119195303b0272e749610b7042cc498be4134f013e9a3215c + +build: + number: 0 + python: + entry_points: + - if: win + then: f2py = numpy.f2py.f2py2e:main + +requirements: + host: + - python + - pip + - cython + - libblas + - libcblas + - liblapack + run: + - python + +tests: + - python: + imports: + - numpy + - numpy.linalg.lapack_lite + pip_check: false + - requirements: + run: + - pytest + - hypothesis + script: + - f2py -h + - if: unix + then: export OPENBLAS_NUM_THREADS=1 + - if: win + then: set OPENBLAS_NUM_THREADS=1 + +about: + license: BSD-3-Clause + license_file: LICENSE.txt + summary: Array processing for numbers, strings, records, and objects. + homepage: http://numpy.scipy.org/ + repository: https://github.com/numpy/numpy + documentation: https://docs.scipy.org/doc/numpy/reference/ + +extra: + recipe-maintainers: + - jakirkham + - msarahan + - pelson + - rgommers + - ocefpaf diff --git a/tests/test_yaml/cross_compile/win_arm64.yaml b/tests/test_yaml/cross_compile/win_arm64.yaml new file mode 100644 index 000000000..1603fd277 --- /dev/null +++ b/tests/test_yaml/cross_compile/win_arm64.yaml @@ -0,0 +1,37 @@ +{% set version = "4.4.1" %} + +package: + name: readline + version: {{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-{{ version }}.tar.gz + sha256: 750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 + +build: + skip: true # [win] + number: 2 + run_exports: + # change soname at major ver: https://abi-laboratory.pro/tracker/timeline/readline/ + - {{ pin_subpackage('readline') }} + +requirements: + build: + - pkg-config + - {{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + +about: + home: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + +extra: + recipe-maintainers: + - croth1 diff --git a/tests/test_yaml/cross_compile/win_arm64_correct.yaml b/tests/test_yaml/cross_compile/win_arm64_correct.yaml new file mode 100644 index 000000000..1603fd277 --- /dev/null +++ b/tests/test_yaml/cross_compile/win_arm64_correct.yaml @@ -0,0 +1,37 @@ +{% set version = "4.4.1" %} + +package: + name: readline + version: {{ version }} + +source: + url: https://github.com/HEASARC/cfitsio/archive/refs/tags/cfitsio-{{ version }}.tar.gz + sha256: 750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 + +build: + skip: true # [win] + number: 2 + run_exports: + # change soname at major ver: https://abi-laboratory.pro/tracker/timeline/readline/ + - {{ pin_subpackage('readline') }} + +requirements: + build: + - pkg-config + - {{ compiler('c') }} + - make + - cmake + host: + - ncurses + run: + - ncurses + +about: + home: https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html + license: GPL-3.0-only + license_file: COPYING + summary: library for editing command lines as they are typed in + +extra: + recipe-maintainers: + - croth1