Skip to content

Commit 8874247

Browse files
jaimergpgoanpecadbast
authored
Add conda-solver option (#291)
* Add conda-solver option * add example * Remove experimental warnings from mamba * lint * fix names * add to ICondaConfig * build * Update dependencies and lint * Update package json * Build --------- Co-authored-by: Gonzalo Peña-Castellanos <[email protected]> Co-authored-by: Daniel Bast <[email protected]>
1 parent ce210e1 commit 8874247

File tree

6 files changed

+63
-8
lines changed

6 files changed

+63
-8
lines changed

Diff for: .github/workflows/example-12.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Example 12: Configure conda solver"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
push:
8+
branches:
9+
- "develop"
10+
- "main"
11+
- "master"
12+
schedule:
13+
# Note that cronjobs run on master/main by default
14+
- cron: "0 0 * * *"
15+
16+
jobs:
17+
example-12:
18+
# prevent cronjobs from running on forks
19+
if:
20+
(github.event_name == 'schedule' && github.repository ==
21+
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
22+
name: Ex12 (os=${{ matrix.os }} solver=${{ matrix.solver }})
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
solver: ["classic", "libmamba"]
28+
os: ["ubuntu-latest", "windows-latest"]
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: ./
32+
id: setup-miniconda
33+
continue-on-error: true
34+
with:
35+
auto-update-conda: true
36+
conda-solver: ${{ matrix.solver }}
37+
python-version: "3.9"
38+
- name: Conda info
39+
shell: bash -el {0}
40+
run: conda info
41+
- name: Conda list
42+
shell: pwsh
43+
run: conda list
44+
- name: Environment
45+
shell: bash -el {0}
46+
run: printenv | sort
47+
- name: Create an environment
48+
shell: bash -el {0}
49+
run: conda create -n unused --dry-run zlib

Diff for: action.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,24 @@ inputs:
222222
default: "true"
223223
mamba-version:
224224
description:
225-
'Experimental. Use mamba (https://github.com/QuantStack/mamba) as a faster
226-
drop-in replacement for conda installs. Disabled by default. To enable,
227-
use "*" or a "x.y" version string.'
225+
'Use mamba (https://github.com/QuantStack/mamba) as a faster drop-in
226+
replacement for conda installs. Disabled by default. To enable, use "*" or
227+
a "x.y" version string.'
228228
required: false
229229
default: ""
230230
use-mamba:
231231
description:
232-
"Experimental. Use mamba as soon as available (either as provided by
232+
"Use mamba as soon as available (either as provided by
233233
`mamba-in-installer` or installation by `mamba-version`)"
234234
required: false
235235
default: ""
236+
conda-solver:
237+
description:
238+
"Which conda solver plugin to use. Only applies to the `conda` client, not
239+
`mamba`. Starting with Miniconda 23.5.2 and Miniforge 23.3.1, you can
240+
choose between `classic` and `libmamba`."
241+
required: false
242+
default: "libmamba"
236243
architecture:
237244
description:
238245
'Architecture of Miniconda that should be installed. Default is "x64". The

Diff for: dist/setup/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47111,7 +47111,6 @@ exports.updateMamba = {
4711147111
label: "update mamba",
4711247112
provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return inputs.mambaVersion !== "" || options.mambaInInstaller; }),
4711347113
toolPackages: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
47114-
core.warning(`Mamba support is still experimental and can result in differently solved environments!`);
4711547114
return {
4711647115
tools: inputs.mambaVersion !== ""
4711747116
? [utils.makeSpec("mamba", inputs.mambaVersion)]
@@ -48190,6 +48189,7 @@ function parseInputs() {
4819048189
channels: core.getInput("channels"),
4819148190
show_channel_urls: core.getInput("show-channel-urls"),
4819248191
use_only_tar_bz2: core.getInput("use-only-tar-bz2"),
48192+
solver: core.getInput("conda-solver"),
4819348193
// These are always set to avoid terminal issues
4819448194
always_yes: "true",
4819548195
changeps1: "false",

Diff for: src/base-tools/update-mamba.ts

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ export const updateMamba: types.IToolProvider = {
1414
provides: async (inputs, options) =>
1515
inputs.mambaVersion !== "" || options.mambaInInstaller,
1616
toolPackages: async (inputs, options) => {
17-
core.warning(
18-
`Mamba support is still experimental and can result in differently solved environments!`,
19-
);
2017
return {
2118
tools:
2219
inputs.mambaVersion !== ""

Diff for: src/input.ts

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export async function parseInputs(): Promise<types.IActionInputs> {
110110
channels: core.getInput("channels"),
111111
show_channel_urls: core.getInput("show-channel-urls"),
112112
use_only_tar_bz2: core.getInput("use-only-tar-bz2"),
113+
solver: core.getInput("conda-solver"),
113114
// These are always set to avoid terminal issues
114115
always_yes: "true",
115116
changeps1: "false",

Diff for: src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export interface ICondaConfig {
6565
use_only_tar_bz2: string;
6666
always_yes: string;
6767
changeps1: string;
68+
solver: string;
6869
}
6970

7071
/**

0 commit comments

Comments
 (0)