Skip to content

Commit

Permalink
Start deprecation of miniforge-variant: Mambaforge (#360)
Browse files Browse the repository at this point in the history
* Warn if Mambaforge is used

* pre-commit

* Also warn for the pypy variant

* Rebuild
  • Loading branch information
jaimergp authored Jul 30, 2024
1 parent 710ac12 commit e5293c8
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 49 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/caching-envs-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
Expand All @@ -65,6 +64,6 @@ jobs:

- name: Update environment
run:
mamba env update -n anaconda-client-env -f
conda env update -n anaconda-client-env -f
etc/example-environment-caching.yml
if: steps.cache.outputs.cache-hit != 'true'
3 changes: 3 additions & 0 deletions .github/workflows/example-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
printenv | sort
example-10-mambaforge:
# NOTE: Mambaforge is now equivalent to Miniforge.
# We are only testing this to make sure there's a smooth transition.
# It should be removed once the product is definitely sunset.
# prevent cronjobs from running on forks
if:
(github.event_name == 'schedule' && github.repository ==
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/example-13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ jobs:
fail-fast: false
matrix:
os: ["macos-14"]
variant:
["Miniforge3", "Mambaforge", "Miniconda", "no-variant", "empty-with"]
variant: ["Miniforge3", "Miniconda", "no-variant", "empty-with"]
include:
# This is Intel, not Apple Silicon, but doesn't bundle Miniconda
- os: macos-13
variant: empty-with
steps:
- uses: actions/checkout@v4
- uses: ./
if: matrix.variant == 'Miniforge3' || matrix.variant == 'Mambaforge'
if: matrix.variant == 'Miniforge3'
id: setup-miniforge
continue-on-error: true
with:
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
shell: bash -el {0}
run: conda create -n unused --dry-run zlib
- name: Run mamba
if: matrix.variant == 'Miniforge3' || matrix.variant == 'Mambaforge'
if: matrix.variant == 'Miniforge3'
shell: bash -el {0}
run: mamba --version
- name: Install Python
Expand Down
48 changes: 9 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ This action sets up a `base`
available in `$CONDA`
- installing a specific (or latest) version of
- [Miniconda3][miniconda-repo]
- [Miniforge][miniforge-releases] (or Mambaforge)
- [Miniforge][miniforge-releases]
- any [constructor]-based installer by or URL or filesystem path

A `conda-build-version` or `mamba-version` may be provided to install specific
versions of `conda` or `mamba` into `base`
versions of `conda` or `mamba` into `base`.

The base `condabin/` folder is added to `$PATH` and shell integration is
initialized across all platforms.
Expand Down Expand Up @@ -403,6 +403,10 @@ jobs:

### Example 6: Mamba

> Note: `conda` 23.10+ uses `conda-libmamba-solver` by default, which provides
> comparable performance to `mamba`. Most users won't need this setting with
> recent conda versions.

Experimental! Use `mamba` to enable much faster conda installs. `mamba-version`
accepts a version string `x.y` (including `"*"`). It requires you specify
`conda-forge` as part of the channels, ideally with the highest priority.
Expand Down Expand Up @@ -509,40 +513,8 @@ jobs:
miniforge-version: latest
```

In addition to `Miniforge3` with `conda` and `CPython`, for each of its many
supported platforms and architectures, additional variants including
`Mambaforge` (which comes pre-installed `mamba` in addition to `conda` on all
platforms) and `Miniforge-pypy3`/`Mamabaforge-pypy3` (which replace `CPython`
with `pypy3` on Linux/MacOS) are available.

```yaml
jobs:
example-10-mambaforge:
name: Ex10 (${{ matrix.os }}, Mambaforge)
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
include:
- os: ubuntu
environment-file: etc/example-environment-no-name.yml
miniforge-variant: Mambaforge
miniforge-version: 4.9.2-4
- os: windows
environment-file: etc/example-explicit.Windows.conda.lock
condarc-file: etc/example-condarc.yml
miniforge-variant: Mambaforge
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
condarc-file: ${{ matrix.condarc-file }}
environment-file: ${{ matrix.environment-file }}
miniforge-variant: ${{ matrix.miniforge-variant }}
miniforge-version: ${{ matrix.miniforge-version }}
use-mamba: true
```
In addition to `Miniforge3` with `conda`, `mamba` and `CPython`, you can also
install `Miniforge-pypy3`, which replaces `CPython` with `PyPy.

### Example 11: Alternative Architectures

Expand Down Expand Up @@ -678,13 +650,11 @@ The first installation step should setup a Miniconda variant without specifying
a environment file.

```yaml
- name: Setup Mambaforge
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
```

It's a good idea to refresh the cache every 24 hours to avoid inconsistencies of
Expand Down
5 changes: 2 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ inputs:
description:
"If provided, this variant of Miniforge will be downloaded and installed.
If `miniforge-version` is not provided, the `latest` version will be used.
Currently-known values: - Miniforge3 (default) - Miniforge-pypy3 -
Mambaforge - Mambaforge-pypy3 Visit
Currently-known values: Miniforge3 (default), Miniforge-pypy3. Visit
https://github.com/conda-forge/miniforge/releases/ for more information on
available variants"
available variants."
required: false
default: ""
miniforge-version:
Expand Down
7 changes: 7 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48150,6 +48150,13 @@ function parseInputs() {
if (core.isDebug()) {
core.info(JSON.stringify(inputs));
}
if (inputs.miniforgeVariant === "Mambaforge" ||
inputs.miniforgeVariant === "Mambaforge-pypy3") {
core.warning("'Mambaforge' variants are now equivalent to 'Miniforge3'. " +
"In the future, we will ignore with a warning and use 'Miniforge3'. " +
"Eventually, using 'Mambaforge' will throw an error. " +
"Please change to 'Miniforge3' at your earliest convenience.");
}
return inputs;
});
}
Expand Down
12 changes: 12 additions & 0 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,17 @@ export async function parseInputs(): Promise<types.IActionInputs> {
core.info(JSON.stringify(inputs));
}

if (
inputs.miniforgeVariant === "Mambaforge" ||
inputs.miniforgeVariant === "Mambaforge-pypy3"
) {
core.warning(
"'Mambaforge' variants are now equivalent to 'Miniforge3'. " +
"In the future, we will ignore with a warning and use 'Miniforge3'. " +
"Eventually, using 'Mambaforge' will throw an error. " +
"Please change to 'Miniforge3' at your earliest convenience.",
);
}

return inputs;
}

0 comments on commit e5293c8

Please sign in to comment.