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

Fall back to miniconda3 latest when no bundled version + empty with params #336

Merged
merged 6 commits into from Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/example-13.yml
Expand Up @@ -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: ./
Expand All @@ -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
Expand Down
10 changes: 7 additions & 3 deletions dist/setup/index.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
dbast marked this conversation as resolved.
Show resolved Hide resolved
* - 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,
jezdez marked this conversation as resolved.
Show resolved Hide resolved
download_miniconda_1.minicondaDownloader,
];
/** See if any provider works with the given inputs and options */
function getLocalInstallerPath(inputs, options) {
Expand Down
5 changes: 3 additions & 2 deletions src/installer/download-miniconda.ts
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion src/installer/index.ts
Expand Up @@ -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 */
Expand Down