From 82cbdc0924aa4405426bc7200237375e83e29c42 Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:34:59 +0100 Subject: [PATCH 1/6] Fall back to miniconda3 latest when no bundled version + empty with params Fixes the no "with"-parameters case on osx-arm64 while there is no bundled version available. --- .github/workflows/example-13.yml | 9 +++++++-- dist/setup/index.js | 10 +++++++--- src/installer/download-miniconda.ts | 5 +++-- src/installer/index.ts | 5 ++++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/example-13.yml b/.github/workflows/example-13.yml index 254083de..bfa7ec97 100644 --- a/.github/workflows/example-13.yml +++ b/.github/workflows/example-13.yml @@ -25,7 +25,8 @@ jobs: fail-fast: false matrix: os: ["macos-14"] - variant: ["Miniforge3", "Mambaforge", "Miniconda", "no-variant"] + variant: + ["Miniforge3", "Mambaforge", "Miniconda", "no-variant", "empty-with"] steps: - uses: actions/checkout@v4 - uses: ./ @@ -46,10 +47,14 @@ jobs: miniconda-version: latest - uses: ./ if: matrix.variant == 'no-variant' - id: setup-miniconda2 + id: setup-miniconda-no-variant continue-on-error: true with: miniforge-version: latest + - uses: ./ + if: matrix.variant == 'empty-with' + id: setup-miniconda-empty-with + continue-on-error: true - name: Conda info shell: bash -el {0} run: conda info diff --git a/dist/setup/index.js b/dist/setup/index.js index 0bb7a264..ef1eee60 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -48920,7 +48920,8 @@ function downloadMiniconda(pythonMajorVersion, inputs) { } let extension = constants.IS_UNIX ? "sh" : "exe"; let osName = constants.OS_NAMES[process.platform]; - const minicondaInstallerName = `Miniconda${pythonMajorVersion}-${inputs.minicondaVersion}-${osName}-${arch}.${extension}`; + let minicondaVersion = inputs.minicondaVersion || "latest"; + const minicondaInstallerName = `Miniconda${pythonMajorVersion}-${minicondaVersion}-${osName}-${arch}.${extension}`; core.info(minicondaInstallerName); // Check version name let versions = yield minicondaVersions(arch); @@ -48948,7 +48949,7 @@ exports.downloadMiniconda = downloadMiniconda; exports.minicondaDownloader = { label: "download Miniconda", provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { - return inputs.minicondaVersion !== "" && inputs.installerUrl === ""; + return inputs.installerUrl === ""; }), installerPath: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () { return { @@ -49175,12 +49176,15 @@ const bundled_miniconda_1 = __nccwpck_require__(3390); * - add any new RULEs in ../input.ts, for example if the installer is not * compatible with some architectures * - add a test! + * - The order is impprtant: + * - the first provider that provides according to the inputs/options is used. + * - the last provider has a fallback in case of no inputs given. */ const INSTALLER_PROVIDERS = [ bundled_miniconda_1.bundledMinicondaUser, download_url_1.urlDownloader, - download_miniconda_1.minicondaDownloader, download_miniforge_1.miniforgeDownloader, + download_miniconda_1.minicondaDownloader, ]; /** See if any provider works with the given inputs and options */ function getLocalInstallerPath(inputs, options) { diff --git a/src/installer/download-miniconda.ts b/src/installer/download-miniconda.ts index 380ab364..918acfd4 100644 --- a/src/installer/download-miniconda.ts +++ b/src/installer/download-miniconda.ts @@ -59,7 +59,8 @@ export async function downloadMiniconda( let extension: string = constants.IS_UNIX ? "sh" : "exe"; let osName: string = constants.OS_NAMES[process.platform]; - const minicondaInstallerName: string = `Miniconda${pythonMajorVersion}-${inputs.minicondaVersion}-${osName}-${arch}.${extension}`; + let minicondaVersion = inputs.minicondaVersion || "latest"; + const minicondaInstallerName: string = `Miniconda${pythonMajorVersion}-${minicondaVersion}-${osName}-${arch}.${extension}`; core.info(minicondaInstallerName); // Check version name @@ -90,7 +91,7 @@ export async function downloadMiniconda( export const minicondaDownloader: types.IInstallerProvider = { label: "download Miniconda", provides: async (inputs, options) => { - return inputs.minicondaVersion !== "" && inputs.installerUrl === ""; + return inputs.installerUrl === ""; }, installerPath: async (inputs, options) => { return { diff --git a/src/installer/index.ts b/src/installer/index.ts index b0189fc2..d84d821f 100644 --- a/src/installer/index.ts +++ b/src/installer/index.ts @@ -22,12 +22,15 @@ import { bundledMinicondaUser } from "./bundled-miniconda"; * - add any new RULEs in ../input.ts, for example if the installer is not * compatible with some architectures * - add a test! + * - The order is impprtant: + * - the first provider that provides according to the inputs/options is used. + * - the last provider has a fallback in case of no inputs given. */ const INSTALLER_PROVIDERS: types.IInstallerProvider[] = [ bundledMinicondaUser, urlDownloader, - minicondaDownloader, miniforgeDownloader, + minicondaDownloader, ]; /** See if any provider works with the given inputs and options */ From f24fa9c4a6d1d7cc0c1dd132b15163f7baca750e Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:18:57 +0100 Subject: [PATCH 2/6] fix --- dist/setup/index.js | 2 +- src/installer/download-miniconda.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index ef1eee60..d9e3ad1d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -48933,7 +48933,7 @@ function downloadMiniconda(pythonMajorVersion, inputs) { return yield base.ensureLocalInstaller({ url: constants.MINICONDA_BASE_URL + minicondaInstallerName, tool: `Miniconda${pythonMajorVersion}`, - version: inputs.minicondaVersion, + version: minicondaVersion, arch: arch, }); }); diff --git a/src/installer/download-miniconda.ts b/src/installer/download-miniconda.ts index 918acfd4..abc2473b 100644 --- a/src/installer/download-miniconda.ts +++ b/src/installer/download-miniconda.ts @@ -76,7 +76,7 @@ export async function downloadMiniconda( return await base.ensureLocalInstaller({ url: constants.MINICONDA_BASE_URL + minicondaInstallerName, tool: `Miniconda${pythonMajorVersion}`, - version: inputs.minicondaVersion, + version: minicondaVersion, arch: arch, }); } From 80b1c58e402ae8b8326881f15dac11ec76cd3455 Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:21:40 +0100 Subject: [PATCH 3/6] Update test --- .github/workflows/example-13.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/example-13.yml b/.github/workflows/example-13.yml index bfa7ec97..9d2eb419 100644 --- a/.github/workflows/example-13.yml +++ b/.github/workflows/example-13.yml @@ -68,7 +68,7 @@ jobs: shell: bash -el {0} run: conda create -n unused --dry-run zlib - name: Run mamba - if: matrix.variant != 'Miniconda' + if: matrix.variant == 'Miniforge3' || matrix.variant == 'Mambaforge' shell: bash -el {0} run: mamba --version - name: Install Python From 9c8c6e738273640d904accf4af4fb54b9109e551 Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:38:43 +0100 Subject: [PATCH 4/6] txt --- dist/setup/index.js | 2 +- src/installer/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d9e3ad1d..0794aea3 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -49176,7 +49176,7 @@ const bundled_miniconda_1 = __nccwpck_require__(3390); * - add any new RULEs in ../input.ts, for example if the installer is not * compatible with some architectures * - add a test! - * - The order is impprtant: + * - The order is important: * - the first provider that provides according to the inputs/options is used. * - the last provider has a fallback in case of no inputs given. */ diff --git a/src/installer/index.ts b/src/installer/index.ts index d84d821f..8ba30670 100644 --- a/src/installer/index.ts +++ b/src/installer/index.ts @@ -22,7 +22,7 @@ import { bundledMinicondaUser } from "./bundled-miniconda"; * - add any new RULEs in ../input.ts, for example if the installer is not * compatible with some architectures * - add a test! - * - The order is impprtant: + * - The order is important: * - the first provider that provides according to the inputs/options is used. * - the last provider has a fallback in case of no inputs given. */ From 080497b3a9b868b4620aeb1cf8d241028f033b8b Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:37:38 +0100 Subject: [PATCH 5/6] Update CHANGELOG --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82956155..db2e94fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # CHANGELOG +## [v3.0.3] (2024-02-27) + +### Fixes + +- [#336] Fall back to miniconda3 latest when no bundled version + empty with + params + +### Tasks and Maintenance + +- [#335] Bump conda-incubator/setup-miniconda from 3.0.1 to 3.0.2 + +[v3.0.3]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v3.0.3 +[#335]: https://github.com/conda-incubator/setup-miniconda/pull/336 +[#336]: https://github.com/conda-incubator/setup-miniconda/pull/336 + ## [v3.0.2] (2024-02-22) ### Fixes From 908cd6fa7e1ef22140c4c89f29e0cc87237ea4ff Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:38:22 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db2e94fb..8db04c62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ - [#335] Bump conda-incubator/setup-miniconda from 3.0.1 to 3.0.2 [v3.0.3]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v3.0.3 -[#335]: https://github.com/conda-incubator/setup-miniconda/pull/336 +[#335]: https://github.com/conda-incubator/setup-miniconda/pull/335 [#336]: https://github.com/conda-incubator/setup-miniconda/pull/336 ## [v3.0.2] (2024-02-22)