diff --git a/.gitignore b/.gitignore index c89ecb7..179afe5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,24 @@ -*.pyc +# User content belongs under recipe/. +# Feedstock configuration goes in `conda-forge.yml` +# Everything else is managed by the conda-smithy rerender process. +# Please do not modify + +# Ignore all files and folders in root +* +!/conda-forge.yml + +# Don't ignore any files/folders if the parent folder is 'un-ignored' +# This also avoids warnings when adding an already-checked file with an ignored parent. +!/**/ +# Don't ignore any files/folders recursively in the following folders +!/recipe/** +!/.ci_support/** -build_artifacts +# Since we ignore files/folders recursively, any folders inside +# build_artifacts gets ignored which trips some build systems. +# To avoid that we 'un-ignore' all files/folders recursively +# and only ignore the root build_artifacts folder. +!/build_artifacts/** +/build_artifacts + +*.pyc diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index f15e8c1..0606aef 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -56,12 +56,6 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi -if [[ "${sha:-}" == "" ]]; then - pushd ${FEEDSTOCK_ROOT} - sha=$(git rev-parse HEAD) - popd -fi - if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index b70ef01..00f377a 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -21,6 +21,12 @@ if [ -z ${FEEDSTOCK_NAME} ]; then export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) fi +if [[ "${sha:-}" == "" ]]; then + pushd "${FEEDSTOCK_ROOT}" + sha=$(git rev-parse HEAD) + popd +fi + docker info # In order for the conda-build process in the container to write to the mounted diff --git a/recipe/0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch b/recipe/0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch new file mode 100644 index 0000000..fc25554 --- /dev/null +++ b/recipe/0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch @@ -0,0 +1,47 @@ +From 5bdf918c02aa774d8fa9d17a2e3deb3771e18ac7 Mon Sep 17 00:00:00 2001 +From: Marcel Bargull +Date: Fri, 2 Feb 2024 12:32:36 +0100 +Subject: [PATCH 1/2] 1.x: Fix repoquery subcommand for Python 3.11/3.12 + +Signed-off-by: Marcel Bargull +--- + mamba/mamba/mamba.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mamba/mamba/mamba.py b/mamba/mamba/mamba.py +index 87e44d4100..0ff25387ea 100644 +--- a/mamba/mamba/mamba.py ++++ b/mamba/mamba/mamba.py +@@ -769,7 +769,7 @@ def format_param(nm, val): + exit_code = update(args, parser) + elif relative_mod == ".main_init": + exit_code = shell_init(args) +- elif relative_mod in (".main_repoquery", "repoquery"): ++ elif relative_mod in (".main_repoquery", ".repoquery"): + exit_code = repoquery(args, parser) + else: + print( + +From f6021f31f1308c62d6114ab1fb2aae3602e0d07c Mon Sep 17 00:00:00 2001 +From: Marcel Bargull +Date: Fri, 2 Feb 2024 12:33:21 +0100 +Subject: [PATCH 2/2] 1.x: Return exit code 1 for non-supported commands + +Signed-off-by: Marcel Bargull +--- + mamba/mamba/mamba.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mamba/mamba/mamba.py b/mamba/mamba/mamba.py +index 0ff25387ea..c1ec492b03 100644 +--- a/mamba/mamba/mamba.py ++++ b/mamba/mamba/mamba.py +@@ -778,7 +778,7 @@ def format_param(nm, val): + " deactivate are supported through mamba." + ) + +- return 0 ++ return 1 + return exit_code + + diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 925131f..50bb509 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -12,6 +12,8 @@ package: source: url: https://github.com/mamba-org/mamba/archive/refs/tags/{{ release }}.tar.gz sha256: 868bb00385029ae45b35e136174164017868edec6f3710bc1644c670db4c0cdb + patches: + - 0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch build: number: 0 @@ -111,7 +113,7 @@ outputs: - python -c "import libmambapy._version; assert libmambapy._version.__version__ == '{{ libmambapy_version }}'" - name: mamba - version: {{ mamba_version }} + version: {{ mamba_version }}.post1 script: build_mamba.sh # [unix] script: build_mamba.bat # [win] build: @@ -129,7 +131,7 @@ outputs: - {{ pin_subpackage('libmambapy', exact=True) }} run: - python - - conda >=23.11,<23.12 + - conda >=23.11,<24.2 - {{ pin_subpackage('libmambapy', exact=True) }} test: @@ -138,18 +140,25 @@ outputs: requires: - pip commands: - - mamba --help - - if exist %PREFIX%\condabin\mamba.bat (exit 0) else (exit 1) # [win] - - test -f ${PREFIX}/etc/profile.d/mamba.sh # [linux] - # these tests work when run on win, but for some reason not during conda build - - mamba create -n test_py2 python=2.7 --dry-run # [unix] - - mamba clean --all --dry-run # [unix] - - mamba repoquery whoneeds conda # [unix] - - mamba install xtensor xsimd -c conda-forge --dry-run # [linux and x86_64] + - test -f ${PREFIX}/condabin/mamba # [unix] + - test -f ${PREFIX}/etc/profile.d/mamba.sh # [unix] + - if not exist %PREFIX%\condabin\mamba.bat exit 1 # [win] + + # Ensure we run the executable from the prefix and not from the base installation. + - test "$(command -v mamba)" = "${PREFIX}/bin/mamba" # [unix] + - cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.bat') do if "%%~dpf"=="%LIBRARY_BIN%\" (exit 0) else (exit 1)" # [win] + - cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.exe') do if "%%~dpf"=="%SCRIPTS%\" (exit 0) else (exit 1)" # [win] + + # We need to run with "call" on Windows since "mamba" runs the batch file; make "call" a passthrough function on Unixes. + - call() { "${@}" ; } # [unix] + - call mamba --help + - call mamba create -n test_py37 python=3.7 --dry-run + - call mamba clean --all --dry-run + - call mamba repoquery whoneeds conda + - call mamba install xtensor xsimd -c conda-forge --dry-run # for some reason tqdm doesn't have a proper colorama dependency so pip check fails # but that's completely unrelated to mamba - python -c "import mamba._version; assert mamba._version.__version__ == '{{ mamba_version }}'" - - test -f ${PREFIX}/condabin/mamba # [unix] about: home: https://github.com/mamba-org/mamba