Skip to content

Commit 0301788

Browse files
authored
Merge pull request #336 from dbast/fix-empty-with
2 parents f023502 + 908cd6f commit 0301788

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

.github/workflows/example-13.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
os: ["macos-14"]
28-
variant: ["Miniforge3", "Mambaforge", "Miniconda", "no-variant"]
28+
variant:
29+
["Miniforge3", "Mambaforge", "Miniconda", "no-variant", "empty-with"]
2930
steps:
3031
- uses: actions/checkout@v4
3132
- uses: ./
@@ -46,10 +47,14 @@ jobs:
4647
miniconda-version: latest
4748
- uses: ./
4849
if: matrix.variant == 'no-variant'
49-
id: setup-miniconda2
50+
id: setup-miniconda-no-variant
5051
continue-on-error: true
5152
with:
5253
miniforge-version: latest
54+
- uses: ./
55+
if: matrix.variant == 'empty-with'
56+
id: setup-miniconda-empty-with
57+
continue-on-error: true
5358
- name: Conda info
5459
shell: bash -el {0}
5560
run: conda info
@@ -63,7 +68,7 @@ jobs:
6368
shell: bash -el {0}
6469
run: conda create -n unused --dry-run zlib
6570
- name: Run mamba
66-
if: matrix.variant != 'Miniconda'
71+
if: matrix.variant == 'Miniforge3' || matrix.variant == 'Mambaforge'
6772
shell: bash -el {0}
6873
run: mamba --version
6974
- name: Install Python

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# CHANGELOG
22

3+
## [v3.0.3] (2024-02-27)
4+
5+
### Fixes
6+
7+
- [#336] Fall back to miniconda3 latest when no bundled version + empty with
8+
params
9+
10+
### Tasks and Maintenance
11+
12+
- [#335] Bump conda-incubator/setup-miniconda from 3.0.1 to 3.0.2
13+
14+
[v3.0.3]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v3.0.3
15+
[#335]: https://github.com/conda-incubator/setup-miniconda/pull/335
16+
[#336]: https://github.com/conda-incubator/setup-miniconda/pull/336
17+
318
## [v3.0.2] (2024-02-22)
419

520
### Fixes

dist/setup/index.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -48920,7 +48920,8 @@ function downloadMiniconda(pythonMajorVersion, inputs) {
4892048920
}
4892148921
let extension = constants.IS_UNIX ? "sh" : "exe";
4892248922
let osName = constants.OS_NAMES[process.platform];
48923-
const minicondaInstallerName = `Miniconda${pythonMajorVersion}-${inputs.minicondaVersion}-${osName}-${arch}.${extension}`;
48923+
let minicondaVersion = inputs.minicondaVersion || "latest";
48924+
const minicondaInstallerName = `Miniconda${pythonMajorVersion}-${minicondaVersion}-${osName}-${arch}.${extension}`;
4892448925
core.info(minicondaInstallerName);
4892548926
// Check version name
4892648927
let versions = yield minicondaVersions(arch);
@@ -48932,7 +48933,7 @@ function downloadMiniconda(pythonMajorVersion, inputs) {
4893248933
return yield base.ensureLocalInstaller({
4893348934
url: constants.MINICONDA_BASE_URL + minicondaInstallerName,
4893448935
tool: `Miniconda${pythonMajorVersion}`,
48935-
version: inputs.minicondaVersion,
48936+
version: minicondaVersion,
4893648937
arch: arch,
4893748938
});
4893848939
});
@@ -48948,7 +48949,7 @@ exports.downloadMiniconda = downloadMiniconda;
4894848949
exports.minicondaDownloader = {
4894948950
label: "download Miniconda",
4895048951
provides: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
48951-
return inputs.minicondaVersion !== "" && inputs.installerUrl === "";
48952+
return inputs.installerUrl === "";
4895248953
}),
4895348954
installerPath: (inputs, options) => __awaiter(void 0, void 0, void 0, function* () {
4895448955
return {
@@ -49175,12 +49176,15 @@ const bundled_miniconda_1 = __nccwpck_require__(3390);
4917549176
* - add any new RULEs in ../input.ts, for example if the installer is not
4917649177
* compatible with some architectures
4917749178
* - add a test!
49179+
* - The order is important:
49180+
* - the first provider that provides according to the inputs/options is used.
49181+
* - the last provider has a fallback in case of no inputs given.
4917849182
*/
4917949183
const INSTALLER_PROVIDERS = [
4918049184
bundled_miniconda_1.bundledMinicondaUser,
4918149185
download_url_1.urlDownloader,
49182-
download_miniconda_1.minicondaDownloader,
4918349186
download_miniforge_1.miniforgeDownloader,
49187+
download_miniconda_1.minicondaDownloader,
4918449188
];
4918549189
/** See if any provider works with the given inputs and options */
4918649190
function getLocalInstallerPath(inputs, options) {

src/installer/download-miniconda.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export async function downloadMiniconda(
5959

6060
let extension: string = constants.IS_UNIX ? "sh" : "exe";
6161
let osName: string = constants.OS_NAMES[process.platform];
62-
const minicondaInstallerName: string = `Miniconda${pythonMajorVersion}-${inputs.minicondaVersion}-${osName}-${arch}.${extension}`;
62+
let minicondaVersion = inputs.minicondaVersion || "latest";
63+
const minicondaInstallerName: string = `Miniconda${pythonMajorVersion}-${minicondaVersion}-${osName}-${arch}.${extension}`;
6364
core.info(minicondaInstallerName);
6465

6566
// Check version name
@@ -75,7 +76,7 @@ export async function downloadMiniconda(
7576
return await base.ensureLocalInstaller({
7677
url: constants.MINICONDA_BASE_URL + minicondaInstallerName,
7778
tool: `Miniconda${pythonMajorVersion}`,
78-
version: inputs.minicondaVersion,
79+
version: minicondaVersion,
7980
arch: arch,
8081
});
8182
}
@@ -90,7 +91,7 @@ export async function downloadMiniconda(
9091
export const minicondaDownloader: types.IInstallerProvider = {
9192
label: "download Miniconda",
9293
provides: async (inputs, options) => {
93-
return inputs.minicondaVersion !== "" && inputs.installerUrl === "";
94+
return inputs.installerUrl === "";
9495
},
9596
installerPath: async (inputs, options) => {
9697
return {

src/installer/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ import { bundledMinicondaUser } from "./bundled-miniconda";
2222
* - add any new RULEs in ../input.ts, for example if the installer is not
2323
* compatible with some architectures
2424
* - add a test!
25+
* - The order is important:
26+
* - the first provider that provides according to the inputs/options is used.
27+
* - the last provider has a fallback in case of no inputs given.
2528
*/
2629
const INSTALLER_PROVIDERS: types.IInstallerProvider[] = [
2730
bundledMinicondaUser,
2831
urlDownloader,
29-
minicondaDownloader,
3032
miniforgeDownloader,
33+
minicondaDownloader,
3134
];
3235

3336
/** See if any provider works with the given inputs and options */

0 commit comments

Comments
 (0)