Skip to content

Commit 5ffa59a

Browse files
authored
Merge pull request #56 from ales-erjavec/miniforge
[ENH] Replace Miniconda with Miniforge
2 parents e6f631a + e9dfd3d commit 5ffa59a

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

.github/workflows/build-conda-installer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
include:
3333
- python-version: "3.11.8"
34-
miniconda-version: "py311_24.1.2-0"
34+
miniforge-version: "24.7.1-0"
3535

3636
defaults:
3737
run:
@@ -99,7 +99,7 @@ jobs:
9999
- name: Build installer
100100
env:
101101
PLATTAG: win_amd64
102-
MINICONDA_VERSION: ${{ matrix.miniconda-version }}
102+
MINIFORGE_VERSION: ${{ matrix.miniforge-version }}
103103
run: |
104104
mkdir dist
105105
export PATH="$(cygpath -u 'C:\Program Files (x86)\NSIS'):$PATH"
@@ -108,7 +108,7 @@ jobs:
108108
--platform $PLATTAG \
109109
--cache-dir .cache \
110110
--dist-dir dist \
111-
--miniconda-version "$MINICONDA_VERSION" \
111+
--miniforge-version "$MINIFORGE_VERSION" \
112112
--env-spec "$CONDA_SPEC_FILE" \
113113
--online no
114114

scripts/windows/PythonHelpers.nsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ FunctionEnd
206206
ReadRegStr $2 ${ROOT_KEY} \
207207
"${__REG_PREFIX}\$1" "DisplayName"
208208
${If} $2 != ""
209-
${StrStr} $3 $2 "Miniconda3"
209+
${StrStr} $3 $2 "Miniforge3"
210210
${StrStr} $4 $2 "Anaconda3"
211211
${LogWrite} " $3 $4"
212212
${If} $3 != ""

scripts/windows/build-conda-installer.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Options:
1717
-d --dist-dir <path> Distribution dir (default ./dist)
1818
--cache-dir <path> Cache downloaded packages in DIR (the default
1919
is \"build/download-cache\")
20-
-M, --miniconda-version <version>
21-
The miniconda distribution to include in the
22-
installer (default ${MINICONDA_VERSION_DEFAULT}).
20+
-M, --miniforge-version <version>
21+
The miniforge distribution to include in the
22+
installer (default ${MINIFORGE_VERSION_DEFAULT}).
2323
--platform <plattag> win32 or win_amd64
2424
--env-spec An environment specification file as exported by
2525
\`conda list --export --explicit --md5\`
2626
(the default is specs/conda-spec.txt)
2727
--online (yes|no) Build an \"online\" or \"offline\" installer.
28-
In an online installer only the Miniconda installer
28+
In an online installer only the Miniforge installer
2929
is included. All other packages are otherwise
3030
fetched at installation time
3131
(offline is currently not recommended).
@@ -46,10 +46,10 @@ BUILDBASE=
4646
DISTDIR=
4747
CACHEDIR=
4848

49-
# Miniconda installer version; included and installed if there is no existing
50-
# Anaconda/Miniconda installation found on the target system.
51-
MINICONDA_VERSION_DEFAULT=4.7.12
52-
MINICONDA_VERSION=${MINICONDA_VERSION_DEFAULT}
49+
# Miniforge installer version; included and installed if there is no existing
50+
# Anaconda/Miniforge installation found on the target system.
51+
MINIFORGE_VERSION_DEFAULT=4.7.12
52+
MINIFORGE_VERSION=${MINIFORGE_VERSION_DEFAULT}
5353

5454
PLATTAG=win_amd64
5555

@@ -74,10 +74,10 @@ while [[ "${1:0:1}" = "-" ]]; do
7474
CACHEDIR=${2:?}; shift 2;;
7575
--cache-dir=*)
7676
CACHEDIR=${1#*=}; shift 1;;
77-
-M|--miniconda-version)
78-
MINICONDA_VERSION=${2:?}; shift 2;;
79-
--miniconda-version=*)
80-
MINICONDA_VERSION=${1*=}; shift 1;;
77+
-M|--miniforge-version)
78+
MINIFORGE_VERSION=${2:?}; shift 2;;
79+
--miniforge-version=*)
80+
MINIFORGE_VERSION=${1#*=}; shift 1;;
8181
--platform)
8282
PLATTAG=${2:?}; shift 2;;
8383
--platform=*)
@@ -156,18 +156,18 @@ version-component() {
156156
echo "${vercomp[comindex]}"
157157
}
158158

159-
fetch-miniconda() {
159+
fetch-miniforge() {
160160
local version="${1:?}"
161161
local platform="${2:?}"
162162
local destdir="${3:?}"
163-
local url="https://repo.continuum.io/miniconda"
163+
local url="https://github.com/conda-forge/miniforge/releases/download/${version}"
164164
local filename=
165165
case "${platform}" in
166166
win32)
167-
filename=Miniconda3-"${version}"-Windows-x86.exe
167+
filename=Miniforge3-"${version}"-Windows-x86.exe
168168
;;
169169
win_amd64)
170-
filename=Miniconda3-"${version}"-Windows-x86_64.exe
170+
filename=Miniforge3-"${version}"-Windows-x86_64.exe
171171
;;
172172
*)
173173
echo "Wrong platform" >&2; return 1;;
@@ -309,9 +309,9 @@ make-installer() {
309309
local scriptdir="$(dirname "$0")"
310310
local nsis_script="${scriptdir:?}/orange-conda.nsi"
311311
local outpath=${DISTDIR:?}
312-
local filename=${NAME:?}-${VERSION:?}-Miniconda-${CONDAPLATTAG}.exe
313-
local pyinstaller=Miniconda3-${MINICONDA_VERSION:?}-Windows-${CONDAPLATTAG}.exe
314-
local extransisparams=( -DMINICONDA_VERSION=${MINICONDA_VERSION:?} )
312+
local filename=${NAME:?}-${VERSION:?}-Miniforge-${CONDAPLATTAG}.exe
313+
local pyinstaller=Miniforge3-${MINIFORGE_VERSION:?}-Windows-${CONDAPLATTAG}.exe
314+
local extransisparams=( -DMINIFORGE_VERSION=${MINIFORGE_VERSION:?} )
315315
if [[ "${ONLINE}" == yes ]]; then
316316
extransisparams+=( -DONLINE )
317317
else
@@ -358,7 +358,7 @@ EOF
358358
"${nsis_script:?}"
359359
}
360360

361-
fetch-miniconda ${MINICONDA_VERSION} ${PLATTAG} "${CACHEDIR:?}"/miniconda
361+
fetch-miniforge ${MINIFORGE_VERSION} ${PLATTAG} "${CACHEDIR:?}"/miniforge
362362

363363
if [[ "${ONLINE}" == yes ]]; then
364364
cat > "${BASEDIR}"/conda-spec.txt < "${ENV_SPEC_FILE}"
@@ -388,7 +388,7 @@ if [[ ! "${PYTHON_VERSION}" ]]; then
388388
exit 1;
389389
fi
390390

391-
cp "${CACHEDIR:?}/miniconda/Miniconda3-${MINICONDA_VERSION}-Windows-${CONDAPLATTAG}.exe" \
391+
cp "${CACHEDIR:?}/miniforge/Miniforge3-${MINIFORGE_VERSION}-Windows-${CONDAPLATTAG}.exe" \
392392
"${BASEDIR:?}/"
393393

394394
mkdir -p "${BASEDIR:?}/icons"

scripts/windows/orange-conda.nsi

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# - PY{MAJOR,MINOR,MICRO} Python version to be installed in the new env
99
# - APPNAME Application (short) name
1010
# - VER{MAJOR,MINOR,MICRO} Application version
11-
# - PYINSTALLER basename of the Miniconda python installer
12-
# - INSTALL_REGISTRY_KEY reg subkey name to use for storing install infomation
11+
# - PYINSTALLER basename of the Miniforge python installer
12+
# - INSTALL_REGISTRY_KEY reg subkey name to use for storing install information
1313
# (details will be stored under Software/${INSTALL_REGISTRY_KEY})
1414

1515

@@ -383,46 +383,46 @@ Function RestoreSilentInstallDir
383383
FunctionEnd
384384

385385

386-
# Section Miniconda
386+
# Section Miniforge
387387
# -----------------
388-
# A Miniconda Python distributions
389-
Section "Miniconda ${MINICONDA_VERSION}" \
390-
SectionMiniconda
388+
# A Miniforge Python distributions
389+
Section "Miniforge ${MINIFORGE_VERSION}" \
390+
SectionMiniforge
391391
${GetAnyAnacondaInstall} $BasePythonPrefix $PythonInstallMode
392392
${If} $BasePythonPrefix != ""
393393
${LogWrite} "Using exising (Ana|Mini)conda installed in \
394394
$BasePythonPrefix"
395395
${Else}
396396
${ExtractTemp} "${BASEDIR}\${PYINSTALLER}" "${TEMPDIR}"
397-
DetailPrint "Installing Miniconda ${MINICONDA_VERSION}"
397+
DetailPrint "Installing Miniforge ${MINIFORGE_VERSION}"
398398
# Why does executing "${TEMPDIR}\${PYINSTALLER}" directly hang the
399-
# Miniconda installer?
399+
# Miniforge installer?
400400
${If} ${Silent}
401401
StrCpy $0 "/S /AddToPath=0 /RegisterPython=0"
402402
${Else}
403403
StrCpy $0 ""
404404
${EndIf}
405405
MessageBox MB_OKCANCEL \
406-
'${APPLICATIONNAME} requires a Miniconda Python distribution \
406+
'${APPLICATIONNAME} requires a Miniforge Python distribution \
407407
installed on the system. This will be done by running a separate \
408408
installer program.$\r$\n$\r$\n\
409409
Click Ok to continue.' \
410-
/SD IDOK IDOK continue_miniconda_ IDCANCEL abort_miniconda_
411-
abort_miniconda_:
412-
Abort "Aborting Miniconda installation (user cancelled)."
413-
continue_miniconda_:
414-
${LogWrite} "Running miniconda installer"
410+
/SD IDOK IDOK continue_miniforge_ IDCANCEL abort_miniforge_
411+
abort_miniforge_:
412+
Abort "Aborting Miniforge installation (user cancelled)."
413+
continue_miniforge_:
414+
${LogWrite} "Running miniforge installer"
415415
${ExecToLog} 'cmd.exe /C "${TEMPDIR}\${PYINSTALLER}" \
416416
$0 /InstallationType=$MultiUser.InstallMode \
417417
'
418418
Pop $0
419419
${If} $0 != 0
420-
Abort "Miniconda installation failed (error value: $0)"
420+
Abort "Miniforge installation failed (error value: $0)"
421421
${EndIf}
422422
${GetAnyAnacondaInstall} $BasePythonPrefix $PythonInstallMode
423423
${If} $BasePythonPrefix == ""
424424
Abort "No anaconda distribution found. Cannot proceed.$\r$\n \
425-
Make sure Miniconda was installed successfully."
425+
Make sure Miniforge was installed successfully."
426426
${EndIF}
427427
${IfNot} ${FileExists} "$BasePythonPrefix\python.exe"
428428
Abort "No python.exe found in $BasePythonPrefix$\r$\n \
@@ -432,12 +432,12 @@ Section "Miniconda ${MINICONDA_VERSION}" \
432432
${LogWrite} "Using conda installation: $BasePythonPrefix"
433433
SectionEnd
434434

435-
Function un.Miniconda
435+
Function un.Miniforge
436436
# Nothing to do. Anaconda installation has its own uninstall.
437437
FunctionEnd
438438

439439

440-
Section "-Miniconda env setup" SectionEnvSetup
440+
Section "-Miniforge env setup" SectionEnvSetup
441441
# Setup the PythonPrefix/PythonExecPrefix... variables
442442
# but does not actualy create any env (this is done in single step
443443
# in InstallPackages section
@@ -760,8 +760,8 @@ FunctionEnd
760760
761761
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
762762
763-
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMiniconda} \
764-
"Install Miniconda ${MINICONDA_VERSION} (${BITS} bit)"
763+
!insertmacro MUI_DESCRIPTION_TEXT ${SectionMiniforge} \
764+
"Install Miniforge ${MINIFORGE_VERSION} (${BITS} bit)"
765765
766766
!insertmacro MUI_DESCRIPTION_TEXT ${InstallPackages} \
767767
"Install required packages into the destination environment"
@@ -790,7 +790,7 @@ Section Uninstall
790790
Call un.Launchers
791791
Call un.InstallPackages
792792
Call un.Environment
793-
Call un.Miniconda
793+
Call un.Miniforge
794794
795795
${If} ${FileExists} "$InstDir\${UNINSTALL_EXEFILE}"
796796
Delete "$InstDir\${UNINSTALL_EXEFILE}"
@@ -823,14 +823,14 @@ Function .onInit
823823
# Found an appropriate python installation and can reuse it
824824
# Change the SectionPython to Unselected
825825
# (change text to Install (use) Private Python?)
826-
SectionGetText ${SectionMiniconda} $0
827-
SectionSetText ${SectionMiniconda} \
826+
SectionGetText ${SectionMiniforge} $0
827+
SectionSetText ${SectionMiniforge} \
828828
"Anaconda python distribution (already installed)"
829-
!insertmacro UnselectSection ${SectionMiniconda}
830-
!insertmacro SetSectionFlag ${SectionMiniconda} ${SF_RO}
829+
!insertmacro UnselectSection ${SectionMiniforge}
830+
!insertmacro SetSectionFlag ${SectionMiniforge} ${SF_RO}
831831
${Else}
832-
!insertmacro SelectSection ${SectionMiniconda}
833-
!insertmacro SetSectionFlag ${SectionMiniconda} ${SF_RO}
832+
!insertmacro SelectSection ${SectionMiniforge}
833+
!insertmacro SetSectionFlag ${SectionMiniforge} ${SF_RO}
834834
${EndIf}
835835
FunctionEnd
836836

0 commit comments

Comments
 (0)