From 1ebc19590fcc0ccf64d917c67ab5670e21cf86bd Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Thu, 1 Feb 2024 09:14:18 +0100 Subject: [PATCH 1/5] MNT: Re-rendered with conda-build 3.28.4, conda-smithy 3.30.4, and conda-forge-pinning 2024.02.01.06.13.37 Signed-off-by: Marcel Bargull --- .gitignore | 25 +++++++++++++++++++++++-- .scripts/build_steps.sh | 6 ------ .scripts/run_docker_build.sh | 6 ++++++ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index c89ecb7d..179afe55 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 f15e8c10..0606aef1 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 b70ef014..00f377a8 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 From 9a2c4ee6d4a0886c09d4e36971d0070e4e9a81f8 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Thu, 1 Feb 2024 22:52:59 +0100 Subject: [PATCH 2/5] Run tests on all platforms Signed-off-by: Marcel Bargull --- recipe/meta.yaml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 925131f2..60b0c170 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -138,18 +138,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_py2 python=2.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 From 0bcbf8ee91a2b98ed06a8c938979263219df6d17 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Thu, 1 Feb 2024 22:55:33 +0100 Subject: [PATCH 3/5] Test environment creation with a non-2.7 Python As of now, one would need to add the conda-forge/label/cf201901 to install python=2.7 on Windows, see https://github.com/conda-forge/python-feedstock/issues/637 . Now in 2024, it should be fine if we just test with another old version. Signed-off-by: Marcel Bargull --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 60b0c170..dfaf24ae 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -150,7 +150,7 @@ outputs: # 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_py2 python=2.7 --dry-run + - 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 From 0fe305af2568bafa6c9d7a07817c34a8c2fd9068 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Fri, 16 Feb 2024 11:41:23 +0100 Subject: [PATCH 4/5] Try allowing conda=24.1 for mamba Signed-off-by: Marcel Bargull --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index dfaf24ae..56d5d461 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -129,7 +129,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: From 057d64a9fbf6648f83872ba9f5da53b8ad11ae12 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Fri, 16 Feb 2024 11:42:44 +0100 Subject: [PATCH 5/5] Add https://github.com/mamba-org/mamba/pull/3170.patch Signed-off-by: Marcel Bargull --- ...uery-subcommand-for-Python-3.11-3.12.patch | 47 +++++++++++++++++++ recipe/meta.yaml | 4 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 recipe/0001-1.x-Fix-repoquery-subcommand-for-Python-3.11-3.12.patch 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 00000000..fc255546 --- /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 56d5d461..50bb509d 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: