Skip to content

Commit

Permalink
use mamba [skip appveyor] [skip azurepipelines] [skip cirrus]
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Oct 23, 2023
1 parent 98e2e32 commit 342c5d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build-conda-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflow_dispatch:
push:
branches:
- "micromamba-installer"
- 'master'
- 'releases/**'
- 'testing/**'
Expand All @@ -31,7 +32,7 @@ jobs:
matrix:
include:
- python-version: "3.9.12"
miniconda-version: "py39_4.12.0"
micromamba-version: "1.5.1-0"

defaults:
run:
Expand Down Expand Up @@ -90,15 +91,17 @@ jobs:
pyqt=5.15.* \
pyqtwebengine=5.15.* \
Orange3=$VERSION \
blas=*=openblas
blas=*=openblas \
mamba
conda list -p ./env --export --explicit --md5 > env-spec.txt
cat env-spec.txt
echo "CONDA_SPEC_FILE=env-spec.txt" >> $GITHUB_ENV
fi
- name: Build installer
env:
PLATTAG: win_amd64
MINICONDA_VERSION: ${{ matrix.miniconda-version }}
MICROMAMBA_VERSION: ${{ matrix.micromamba-version }}
run: |
mkdir dist
export PATH="$(cygpath -u 'C:\Program Files (x86)\NSIS'):$PATH"
Expand All @@ -107,7 +110,7 @@ jobs:
--platform $PLATTAG \
--cache-dir .cache \
--dist-dir dist \
--miniconda-version "$MINICONDA_VERSION" \
--micromamba-version "$MICROMAMBA_VERSION" \
--env-spec "$CONDA_SPEC_FILE" \
--online no
Expand Down
31 changes: 11 additions & 20 deletions scripts/windows/micromambainstall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@ rem Path to micromamba executable
set MICROMAMBA=%~2
set MAMBA_ROOT_PREFIX=%~3

rem mamba has problems installing from "local" files? Make pkgs available in
rem pkg cache
rem mkdir "%PREFIX%\pkgs"
rem copy *.conda *.bz2 "%PREFIX%\pkgs"
rem !!! ~FIX THIS: !!! root prefix cannot be the same as install prefix ??!!!
rem !!! FIX THIS:Non-conda folder exists at prefix ?? !!!

if not exist "%PREFIX%\conda-meta" (
echo Creating a conda env in "%PREFIX%"
mkdir "%PREFIX%\conda-meta"
rem # Create an empty initial skeleton to layout the conda, activate.bat
rem # and other things needed to manage the environment.
call "%MICROMAMBA%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%PREFIX%" --file .\conda-spec.txt ^
|| exit /b !ERRORLEVEL!
) else (
call "%MICROMAMBA%" install --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%PREFIX%" --file .\conda-spec.txt ^
|| exit /b !ERRORLEVEL!
)
if not exist "%PREFIX%\pkgs" (
mkdir "%PREFIX%\pkgs"
)
call "%MICROMAMBA%" install --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%PREFIX%" --file .\conda-spec.txt ^
|| exit /b !ERRORLEVEL!

call "%MICROMAMBA%" install --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%PREFIX%" mamba

Expand All @@ -44,13 +35,13 @@ set "CONDA_BAT=%PREFIX%\Scripts\conda.bat"
echo @echo off> "%CONDA_BAT%"
echo call "%PREFIX%\condabin\mamba" --prefix "%PREFIX%" %%*>> "%CONDA_BAT%"

%MICROMAMBA% --root-prefix %MAMBA_ROOT_PREFIX% shell hook -s cmd.exe
:: %MICROMAMBA% --root-prefix %MAMBA_ROOT_PREFIX% shell hook -s cmd.exe

set "ACTIVATE_BAT=%PREFIX%\Scripts\activate.bat"
if not exist "%ACTIVATE_BAT%" (
echo @echo off > "%ACTIVATE_BAT%"
echo call "%MAMBA_ROOT_PREFIX%\condabin\activate.bat" "%PREFIX%" >> "%ACTIVATE_BAT%"
)
::set "ACTIVATE_BAT=%PREFIX%\Scripts\activate.bat"
::if not exist "%ACTIVATE_BAT%" (
:: echo @echo off > "%ACTIVATE_BAT%"
:: echo call "%MAMBA_ROOT_PREFIX%\condabin\activate.bat" "%PREFIX%" >> "%ACTIVATE_BAT%"
::)

rem # install custom sitecustomize module
copy sitecustomize.py "%PREFIX%\Lib\

0 comments on commit 342c5d2

Please sign in to comment.