diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 619c1b25..22d356e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: TARGET_PLATFORM: osx-arm64 OS_NAME: "MacOSX" - - os: macos-latest + - os: macos-13 # Force Intel ARCH: x86_64 TARGET_PLATFORM: osx-64 OS_NAME: "MacOSX" diff --git a/Miniforge3/construct.yaml b/Miniforge3/construct.yaml index f6b596bf..fbdd2659 100644 --- a/Miniforge3/construct.yaml +++ b/Miniforge3/construct.yaml @@ -1,5 +1,5 @@ -{% set version = os.environ.get("MINIFORGE_VERSION", "25.3.0-3") %} -{% set conda_libmamba_solver_version = "25.3.0" %} +{% set version = os.environ.get("MINIFORGE_VERSION", "25.5.1-1") %} +{% set conda_libmamba_solver_version = "25.4.0" %} # This file is parsed by the scripts to define # - `MICROMAMBA_VERSION` in `scripts/build.sh` # - `MAMBA_VERSION` in `scripts/test.sh` @@ -16,6 +16,11 @@ channels: - conda-forge write_condarc: True +condarc: | + channels: + - conda-forge + default_activation_env: default-env + # keep pkgs for space-saving implications for hardlinks when create new environments # and keep the same with Miniconda keep_pkgs: True @@ -36,12 +41,18 @@ user_requested_specs: specs: - python 3.12.* - - conda {{ version.split("-")[0] }} - - mamba {{ mamba_version }} + - conda {{ version.split("-")[0] }}.* + - mamba {{ mamba_version }}.* - conda-libmamba-solver {{ conda_libmamba_solver_version }} - pip - miniforge_console_shortcut 1.* # [win] +extra_envs: + default-env: + specs: + - python 3.12.* + - pip + virtual_specs: - __glibc >=2.17 # [linux] - __osx >=10.13 # [osx] diff --git a/scripts/test.sh b/scripts/test.sh index 34858827..86d7ed5a 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -29,22 +29,26 @@ if [[ "$(uname)" == MINGW* ]]; then echo "***** Setup conda *****" # Workaround a conda bug where it uses Unix style separators, but MinGW doesn't understand them + # we need condabin in PATH for both conda and mamba export PATH=$CONDA_PATH/Library/bin:$PATH # shellcheck disable=SC1091 - source "${CONDA_PATH}/Scripts/activate" - conda.exe config --set show_channel_urls true + eval "$("$CONDA_PATH/python.exe" -m conda shell.posix hook)" + eval "$("$CONDA_PATH/Library/bin/mamba.exe" shell hook)" + conda config --set show_channel_urls true echo "***** Print conda info *****" - conda.exe info - conda.exe list + conda info + conda list + conda info --envs + conda config --show-sources echo "***** Check if we are bundling packages from msys2 or defaults *****" - conda.exe list | grep defaults && exit 1 - conda.exe list | grep msys2 && exit 1 + conda list | grep defaults && exit 1 + conda list | grep msys2 && exit 1 echo "***** Check if we can install a package which requires msys2 *****" - conda.exe install r-base --yes --quiet - conda.exe list + conda install r-base --yes --quiet + conda list else # Test one of our installers in batch mode if [[ "${INSTALLER_NAME}" == "Miniforge3" ]]; then @@ -66,13 +70,18 @@ EOF echo "***** Setup conda *****" # shellcheck disable=SC1091 - source "${CONDA_PATH}/bin/activate" + eval "$("$CONDA_PATH/bin/python" -m conda shell.posix hook)" + eval "$("$CONDA_PATH/bin/mamba" shell hook)" echo "***** Print conda info *****" conda info conda list + conda info --envs + conda config --show-sources fi +set +x + echo "+ Mamba does not warn (check that there is no warning on stderr) and returns exit code 0" mamba --help 2> stderr.log || cat stderr.log test ! -s stderr.log @@ -96,7 +105,13 @@ echo "+ Testing mamba channels" mamba info --json | python -c "import sys, json; info = json.loads(sys.stdin.read()); assert any('${MINIFORGE_CHANNEL_NAME}' in c for c in info['channels']), info" echo " OK" +set -x + echo "***** Python path *****" +# These tests use Python, which does need an active environment + +conda activate + python -c "import sys; print(sys.executable)" python -c "import sys; assert 'miniforge' in sys.executable" @@ -107,6 +122,29 @@ python -c "import platform; print(platform.system())" python -c "import platform; print(platform.machine())" python -c "import platform; print(platform.release())" +conda deactivate + +echo "***** Check default environment *****" + +conda activate +default_prefix_nameless="$CONDA_PREFIX" +echo "default_prefix_nameless=$default_prefix_nameless" +default_python_nameless="$(type python)" +echo "default_python_nameless=$default_python_nameless" +python -V +conda deactivate + +conda activate default-env +default_prefix="$CONDA_PREFIX" +echo "default_prefix=$default_prefix" +default_python="$(type python)" +echo "default_python=$default_python" +python -V +conda deactivate + +test "$default_prefix_nameless" = "$default_prefix" +test "$default_python_nameless" = "$default_python" + echo "***** Done: Testing installer *****" echo "***** Testing the usage of mamba main commands *****"