Skip to content

Update installation docs #6188

Update installation docs

Update installation docs #6188

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
libmamba_static:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-static-dev.yml
environment-name: build_env
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
- name: build libmamba-static
shell: bash -l {0}
run: |
mkdir build
cd build
cmake .. -DBUILD_LIBMAMBA=ON \
-DBUILD_STATIC=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-GNinja
ninja
- name: build cache statistics
run: sccache --show-stats
libmamba_cpp_tests:
needs: [libmamba_static]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-dev.yml
environment-name: build_env
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: Build libmamba
shell: bash -l {0}
run: |
cmake -B build/ \
-D BUILD_LIBMAMBA=ON \
-D BUILD_SHARED=ON \
-D BUILD_LIBMAMBA_TESTS=ON \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-G Ninja
cmake --build build/ --parallel --target test_libmamba testing_libmamba_lock
- name: Run libmamba tests
shell: bash -l {0}
run: |
unset CONDARC # Interferes with tests
cd build && ninja test
- name: build cache statistics
run: sccache --show-stats
umamba_tests:
needs: [libmamba_static]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: build micromamba
shell: bash -l {0}
run: |
cmake -B build/ \
-D BUILD_MICROMAMBA=ON \
-D BUILD_MICROMAMBA_SERVER=ON \
-D BUILD_LIBMAMBA=ON \
-D BUILD_SHARED=ON \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-G Ninja
cmake --build build/ --parallel
- name: build cache statistics
run: sccache --show-stats
- name: install zsh, xonsh, fish and tcsh in linux
if: matrix.os == 'ubuntu-latest'
shell: bash -l -eo pipefail {0}
run: |
sudo apt-get install zsh xonsh fish tcsh -y
- name: install xonsh and fish in mac
if: matrix.os == 'macos-latest'
shell: bash -l -eo pipefail {0}
run: |
brew install fish xonsh
- name: micromamba python based tests
shell: bash -l -eo pipefail {0}
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/micromamba
unset CONDARC # Interferes with tests
pytest -v --capture=tee-sys micromamba/tests/
mamba_python_tests:
needs: [libmamba_static]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python_version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./mamba/environment-dev.yml
environment-name: build_env
cache-environment: true
create-args: >-
conda-build
python=${{ matrix.python_version }}
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static-${{ matrix.os }}
- name: run conda init
shell: bash -l {0}
run: conda init
- name: build libmamba Python bindings
shell: bash -l {0}
run: |
cmake -B build/ \
-D CMAKE_INSTALL_PREFIX="${CONDA_PREFIX}" \
-D BUILD_LIBMAMBAPY=ON \
-D BUILD_LIBMAMBA=ON \
-D BUILD_MICROMAMBA=ON \
-D BUILD_SHARED=ON \
-D BUILD_MAMBA_PACKAGE=ON \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-G Ninja
cmake --build build/ --parallel
cmake --install build/
- name: install libmambapy
shell: bash -l {0}
run: |
python -m pip install --no-deps --no-build-isolation --editable ./libmambapy/
- name: check libmambapy stubs
shell: bash -l {0}
run: |
pybind11-stubgen libmambapy.bindings
python compare_stubs.py libmambapy/libmambapy/__init__.pyi stubs/libmambapy/bindings-stubs/__init__.pyi
- name: build cache statistics
run: sccache --show-stats
- name: install mamba
shell: bash -l {0}
run: |
python -m pip install --no-deps --no-build-isolation ./mamba[test]
- name: run mamba tests suite
shell: bash -l {0}
run: |
unset CONDARC # Interferes with tests
pytest -v --capture=tee-sys mamba/tests
- name: run mamba create/update tests
shell: bash -l {0}
run: |
unset CONDARC # Interferes with tests
mamba create -n test_env xtensor -c conda-forge -y
mamba env create -f mamba/tests/test_env.yml
mamba env update -f mamba/tests/update_env.yml
- name: run mamba local channel test
shell: bash -l {0}
run: |
unset CONDARC # Interferes with tests
if [ "$RUNNER_OS" == "Linux" ]; then
mkdir -p $CONDA_PREFIX/conda-bld/linux-64
wget -P $CONDA_PREFIX/conda-bld/linux-64 https://anaconda.org/conda-forge/xtensor/0.21.8/download/linux-64/xtensor-0.21.8-hc9558a2_0.tar.bz2
wget -P $CONDA_PREFIX/conda-bld/linux-64 https://anaconda.org/conda-forge/xtl/0.6.21/download/linux-64/xtl-0.6.21-h0efe328_0.tar.bz2
else
mkdir -p $CONDA_PREFIX/conda-bld/osx-64
wget -P $CONDA_PREFIX/conda-bld/osx-64 https://anaconda.org/conda-forge/xtensor/0.21.8/download/osx-64/xtensor-0.21.8-h879752b_0.tar.bz2
wget -P $CONDA_PREFIX/conda-bld/osx-64 https://anaconda.org/conda-forge/xtl/0.6.21/download/osx-64/xtl-0.6.21-h6516342_0.tar.bz2
fi
conda index $CONDA_PREFIX/conda-bld
mamba create -n l_o_cal_test xtensor -c local -c conda-forge -y
conda list -n l_o_cal_test
conda list -n l_o_cal_test | tail -n +3 > list.txt
if [ "$(grep -c "local" list.txt)" -ne 2 ]; then
exit 1
fi
- name: Run server auth tests
shell: bash -l {0} -euo pipefail -x
run: |
export TEST_MAMBA_EXE="${PWD}/build/micromamba/micromamba"
cd mamba/tests
if [[ "$(uname -s)" == "Linux" ]]; then
./generate_gpg_keys.sh
fi
./testserver.sh
- name: Shell init
shell: bash -l {0} -euo pipefail -x
run: |
mamba init
libmamba_static_win:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-static-dev-win.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
- name: remove vcpkg manifest file
# we need to remove the vcpkg.json file to be able to work not in manifest mode
run: rm vcpkg.json
- name: Get Week
id: get-week
shell: bash
run: echo "week=$(/bin/date -u "+%Y%U")" >> "${GITHUB_OUTPUT}"
- name: Restore cached VCPKG dependencies
id: cache-vcpkg-restore
uses: actions/cache/restore@v3
with:
path: C:\vcpkg
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-week.outputs.week }}-
- name: Build static windows dependencies with vcpkg
shell: cmd /C CALL {0}
# Latest VCPKG is from GHA because releases are not up to date with VCPKG server
run: |
if %errorlevel% neq 0 exit /b %errorlevel%
set VCPKG_ROOT=C:\vcpkg
if %errorlevel% neq 0 exit /b %errorlevel%
ROBOCOPY .\ports\libsolv %VCPKG_ROOT%\ports\libsolv
@rem ROBOCOPY has 0 and 1 as successfull exit codes
if %errorlevel% neq 0 if %errorlevel% neq 1 exit /b %errorlevel%
SET VCPKG_BUILD_TYPE=release && vcpkg install libsolv[conda] --triplet x64-windows-static
if %errorlevel% neq 0 exit /b %errorlevel%
vcpkg install "libarchive[bzip2,lz4,lzma,lzo,openssl,zstd]" --triplet x64-windows-static
if %errorlevel% neq 0 exit /b %errorlevel%
vcpkg install curl --triplet x64-windows-static
if %errorlevel% neq 0 exit /b %errorlevel%
vcpkg install yaml-cpp --triplet x64-windows-static
if %errorlevel% neq 0 exit /b %errorlevel%
vcpkg install reproc --triplet x64-windows-static
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Save VCPKG dependencies
uses: actions/cache/save@v3
with:
path: C:\vcpkg
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
- name: build libmamba-static
shell: cmd /C call {0}
run: |
if %errorlevel% neq 0 exit /b %errorlevel%
@rem Used by CMake
set VCPKG_ROOT=C:\vcpkg
if %errorlevel% neq 0 exit /b %errorlevel%
cmake -B build ^
-D CMAKE_PREFIX_PATH=C:\vcpkg\installed\x64-windows-static\ ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_STATIC=ON ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache ^
-G Ninja
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build --parallel
if %errorlevel% neq 0 exit /b %errorlevel%
- name: build cache statistics
run: sccache --show-stats
mamba_python_tests_win:
needs: [libmamba_static_win]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./mamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
create-args: >-
conda-build
curl
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static_win-${{ matrix.os }}
- name: run conda init
shell: bash -l {0}
run: conda init
- name: build libmamba Python bindings
shell: cmd /C call {0}
run: |
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir build
if %errorlevel% neq 0 exit /b %errorlevel%
cd build
if %errorlevel% neq 0 exit /b %errorlevel%
cmake .. -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DBUILD_LIBMAMBAPY=ON ^
-DBUILD_LIBMAMBA=ON ^
-DBUILD_SHARED=ON ^
-DBUILD_MAMBA_PACKAGE=ON ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-GNinja
if %errorlevel% neq 0 exit /b %errorlevel%
ninja
if %errorlevel% neq 0 exit /b %errorlevel%
ninja install
- name: install libmambapy
shell: cmd /C call {0}
run: |
pip install -e .\libmambapy\ --no-deps
- name: build cache statistics
run: sccache --show-stats
- name: install mamba
shell: bash -l {0}
run: |
python --version
pip install ./mamba[test] --no-deps
- name: run mamba tests suite
shell: bash -l {0}
run: pytest -v --capture=tee-sys mamba/tests
- name: Run create command
shell: bash -l {0}
run: mamba create -n test_env xtensor -c conda-forge -y
- name: Run env create command
shell: bash -l {0}
run: mamba env create -f mamba/tests/test_env.yml
- name: Run env update command
shell: bash -l {0}
run: mamba env update -f mamba/tests/update_env.yml
- name: Run local channel checks
shell: bash -l {0}
run: |
mkdir -p $CONDA_PREFIX/conda-bld/win-64
echo $PATH
micromamba list
micromamba info
curl --version
curl https://anaconda.org/conda-forge/xtensor/0.21.7/download/win-64/xtensor-0.21.7-h7ef1ec2_0.tar.bz2 -L -o $CONDA_PREFIX/conda-bld/win-64/xtensor-0.21.7-h7ef1ec2_0.tar.bz2
curl https://anaconda.org/conda-forge/xtl/0.6.21/download/win-64/xtl-0.6.21-h5362a0b_0.tar.bz2 -L -o $CONDA_PREFIX/conda-bld/win-64/xtl-0.6.21-h5362a0b_0.tar.bz2
conda index $CONDA_PREFIX/conda-bld
mamba create -n l_o_cal_test xtensor -c local -c conda-forge -y
conda list -n l_o_cal_test
# cut first couple of lines to remove prefix path
conda list -n l_o_cal_test | tail -n +3 > list.txt
if [ "$(grep -c "local" list.txt)" -ne 2 ]; then
exit 1
fi
libmamba_cpp_tests_win:
needs: [libmamba_static_win]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static_win-${{ matrix.os }}
- name: build and run libmamba C++ tests
shell: cmd /C call {0}
run: |
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir build
if %errorlevel% neq 0 exit /b %errorlevel%
cd build
if %errorlevel% neq 0 exit /b %errorlevel%
cmake .. -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DBUILD_LIBMAMBA_TESTS=ON ^
-DBUILD_LIBMAMBA=ON ^
-DBUILD_SHARED=ON ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-GNinja
if %errorlevel% neq 0 exit /b %errorlevel%
ninja install
if %errorlevel% neq 0 exit /b %errorlevel%
@REM Interferes with tests
set CONDARC=
ninja test
- name: build cache statistics
run: sccache --show-stats
umamba_tests_win:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba_static_win-${{ matrix.os }}
- name: build micromamba
shell: cmd /C call {0}
run: |
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir build
if %errorlevel% neq 0 exit /b %errorlevel%
cd build
if %errorlevel% neq 0 exit /b %errorlevel%
cmake .. -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DBUILD_MICROMAMBA=ON ^
-DBUILD_LIBMAMBA=ON ^
-DBUILD_SHARED=ON ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-GNinja
if %errorlevel% neq 0 exit /b %errorlevel%
ninja install
- name: check that micromamba runs
shell: cmd /C call {0}
run: .\build\micromamba\micromamba.exe --help
- name: build cache statistics
run: sccache --show-stats
- name: tar micromamba artifact
shell: cmd /C call {0}
run: |
cp build/libmamba/libmamba.dll build/micromamba/
tar -cvf umamba.tar build/micromamba/micromamba.exe build/micromamba/libmamba.dll
- uses: actions/upload-artifact@v3
with:
name: _internal_micromamba_binary
path: umamba.tar
umamba_tests_win_cmd:
needs: [umamba_tests_win]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: _internal_micromamba_binary
- name: untar micromamba artifact
shell: bash -l -eo pipefail {0}
run: |
tar -xvf umamba.tar
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
create-args: menuinst
init-shell: bash cmd.exe powershell
- name: micromamba python based tests with pwsh
shell: pwsh
run: |
$env:PYTHONIOENCODING='UTF-8'
$env:MAMBA_ROOT_PREFIX = Join-Path -Path $pwd -ChildPath 'mambaroot'
$env:TEST_MAMBA_EXE = Join-Path -Path $pwd -ChildPath 'build\micromamba\micromamba.exe'
$env:MAMBA_TEST_SHELL_TYPE='powershell'
Remove-Item -Path "env:CONDARC"
pytest -v --capture=tee-sys micromamba/tests/
# - name: micromamba python based tests
# shell: cmd /C call {0}
# run: |
# if %errorlevel% neq 0 exit /b %errorlevel%
# set PYTHONIOENCODING=UTF-8
# if %errorlevel% neq 0 exit /b %errorlevel%
# set MAMBA_ROOT_PREFIX=%cd%\mambaroot
# if %errorlevel% neq 0 exit /b %errorlevel%
# set MAMBA_TEST_SHELL_TYPE=cmd.exe
# if %errorlevel% neq 0 exit /b %errorlevel%
# reg delete "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v AutoRun /f
# if %errorlevel% neq 0 exit /b %errorlevel%
#
# pytest -v --capture=tee-sys micromamba/tests/test_shell.py
# - name: micromamba python based tests
# shell: bash -l -eo pipefail {0}
# run: |
# export PYTHONIOENCODING=UTF-8
# export MAMBA_ROOT_PREFIX=~/mambaroot
# export MAMBA_TEST_SHELL_TYPE=bash
#
# pytest -v --capture=tee-sys micromamba/tests/test_shell.py