Skip to content

Commit

Permalink
fix: download micromamba on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jan 7, 2024
1 parent 25c81d6 commit 41d66dd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ testing

.vscode/

micromamba.exe
micromamba.tar.bz2
info/
library/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -157,4 +162,4 @@ cython_debug/
#.idea/

bin/*
conda/*
conda/*
11 changes: 11 additions & 0 deletions download_micromamba.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Download micromamba if it doesn't exist, suppressing any errors
if (!(Test-Path "micromamba.exe")) {
Write-Output "* Downloading micromamba"
Invoke-Webrequest -URI https://micro.mamba.pm/api/micromamba/win-64/latest -OutFile micromamba.tar.bz2
tar xf micromamba.tar.bz2

Move-Item -Force Library\bin\micromamba.exe micromamba.exe

Remove-Item micromamba.tar.bz2
Remove-Item -r ./Library/
}
2 changes: 1 addition & 1 deletion runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ IF EXIST CONDA GOTO APP
call update-runtime

:APP
umamba.exe shell hook -s cmd.exe -p "%MAMBA_ROOT_PREFIX%" -v
micromamba.exe shell hook -s cmd.exe -p "%MAMBA_ROOT_PREFIX%" -v
call "%MAMBA_ROOT_PREFIX%\condabin\mamba_hook.bat"
call "%MAMBA_ROOT_PREFIX%\condabin\micromamba.bat" activate windows
%*
Expand Down
9 changes: 6 additions & 3 deletions update-runtime.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@echo off
powershell.exe -File .\download_micromamba.ps1

cd /d "%~dp0"

:Isolation
Expand All @@ -9,6 +11,7 @@ SET MAMBA_ROOT_PREFIX=%~dp0conda
echo %MAMBA_ROOT_PREFIX%



setlocal EnableDelayedExpansion
for %%a in (%*) do (
if /I "%%a"=="--hordelib" (
Expand All @@ -34,13 +37,13 @@ if defined scribe (
Reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d "1" /f 2>nul
:We do this twice the first time to workaround a conda bug where pip is not installed correctly the first time - Henk
IF EXIST CONDA GOTO WORKAROUND_END
umamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
micromamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
:WORKAROUND_END
umamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y
micromamba create --no-shortcuts -r conda -n windows -f %CONDA_ENVIRONMENT_FILE% -y

REM Check if hordelib argument is defined

umamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v
micromamba.exe shell hook -s cmd.exe -p %MAMBA_ROOT_PREFIX% -v
call "%MAMBA_ROOT_PREFIX%\condabin\mamba_hook.bat"
call "%MAMBA_ROOT_PREFIX%\condabin\micromamba.bat" activate windows

Expand Down

0 comments on commit 41d66dd

Please sign in to comment.