Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda-solver option #291

Merged
merged 12 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/example-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Example 12: Configure conda solver"

on:
pull_request:
branches:
- "*"
push:
branches:
- "develop"
- "main"
- "master"
schedule:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

jobs:
example-12:
# prevent cronjobs from running on forks
if:
(github.event_name == 'schedule' && github.repository ==
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name: Ex12 (os=${{ matrix.os }} solver=${{ matrix.solver }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
solver: ["classic", "libmamba"]
os: ["ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v2
- uses: ./
id: setup-miniconda
continue-on-error: true
with:
auto-update-conda: true
conda-solver: ${{ matrix.solver }}
python-version: "3.9"
- name: Conda info
shell: bash -el {0}
run: conda info
- name: Conda list
shell: pwsh
run: conda list
- name: Environment
shell: bash -el {0}
run: printenv | sort
- name: Create an environment
shell: bash -el {0}
run: conda create -n unused --dry-run zlib
15 changes: 11 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,24 @@ inputs:
default: "true"
mamba-version:
description:
'Experimental. Use mamba (https://github.com/QuantStack/mamba) as a faster
drop-in replacement for conda installs. Disabled by default. To enable,
use "*" or a "x.y" version string.'
'Use mamba (https://github.com/QuantStack/mamba) as a faster drop-in
replacement for conda installs. Disabled by default. To enable, use "*" or
a "x.y" version string.'
required: false
default: ""
use-mamba:
description:
"Experimental. Use mamba as soon as available (either as provided by
"Use mamba as soon as available (either as provided by
`mamba-in-installer` or installation by `mamba-version`)"
required: false
default: ""
conda-solver:
description:
"Which conda solver plugin to use. Only applies to the `conda` client, not
`mamba`. Starting with Miniconda 23.5.2 and Miniforge 23.3.1, you can
choose between `classic` and `libmamba`."
required: false
default: "libmamba"
architecture:
description:
'Architecture of Miniconda that should be installed. Available options on
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24955,7 +24955,6 @@ exports.updateMamba = {
label: "update mamba",
provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return inputs.mambaVersion !== "" || options.mambaInInstaller; }),
toolPackages: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
core.warning(`Mamba support is still experimental and can result in differently solved environments!`);
return {
tools: inputs.mambaVersion !== ""
? [utils.makeSpec("mamba", inputs.mambaVersion)]
Expand Down Expand Up @@ -26032,6 +26031,7 @@ function parseInputs() {
channels: core.getInput("channels"),
show_channel_urls: core.getInput("show-channel-urls"),
use_only_tar_bz2: core.getInput("use-only-tar-bz2"),
solver: core.getInput("conda-solver"),
// These are always set to avoid terminal issues
always_yes: "true",
changeps1: "false",
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"husky": "^8.0.3",
"lerna": "^6.0.3",
"lint-staged": "^13.0.3",
"lodash": ">=4.17.21",
Expand Down
3 changes: 0 additions & 3 deletions src/base-tools/update-mamba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const updateMamba: types.IToolProvider = {
provides: async (inputs, options) =>
inputs.mambaVersion !== "" || options.mambaInInstaller,
toolPackages: async (inputs, options) => {
core.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So mamba support is no longer experimental?

Should we still warn about "differently solved environments!" @jaimergp ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point I'd expect people to know enough about it.

`Mamba support is still experimental and can result in differently solved environments!`
);
return {
tools:
inputs.mambaVersion !== ""
Expand Down
1 change: 1 addition & 0 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export async function parseInputs(): Promise<types.IActionInputs> {
channels: core.getInput("channels"),
show_channel_urls: core.getInput("show-channel-urls"),
use_only_tar_bz2: core.getInput("use-only-tar-bz2"),
solver: core.getInput("conda-solver"),
// These are always set to avoid terminal issues
always_yes: "true",
changeps1: "false",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface ICondaConfig {
use_only_tar_bz2: string;
always_yes: string;
changeps1: string;
solver: string;
}

/**
Expand Down
Loading