From af04d0a8f9ebe65b70e263683b31d029d3113362 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 2 Oct 2024 23:40:35 +0200 Subject: [PATCH] Same but with pixi --- .ci_support/requirements.txt | 21 ++++++++++++--------- .ci_support/requirements.yaml | 13 +++++++++++++ .gitattributes | 2 ++ .gitignore | 1 + .scripts/run_osx_build.sh | 19 +++++++++---------- .scripts/run_win_build.bat | 27 +++++++++++++-------------- 6 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 .ci_support/requirements.yaml diff --git a/.ci_support/requirements.txt b/.ci_support/requirements.txt index 74235d11fc4e7..0824e5b10823d 100644 --- a/.ci_support/requirements.txt +++ b/.ci_support/requirements.txt @@ -1,9 +1,12 @@ -conda>=23.7.3 -conda-libmamba-solver>=23.7.0 -conda-build>=24.3 -conda-index>=0.3.0 -conda-forge-ci-setup>=4.9.3,<5.0 -conda-forge-pinning -frozendict -networkx=2.4 -rattler-build-conda-compat>=1.2.0,<2.0.0a0 +channels: +- conda-forge +dependencies: +- conda>=23.7.3 +- conda-libmamba-solver>=23.7.0 +- conda-build>=24.3 +- conda-index>=0.3.0 +- conda-forge-ci-setup>=4.9.3,<5.0 +- conda-forge-pinning +- frozendict +- networkx=2.4 +- rattler-build-conda-compat>=1.2.0,<2.0.0a0 diff --git a/.ci_support/requirements.yaml b/.ci_support/requirements.yaml new file mode 100644 index 0000000000000..35edece91e12a --- /dev/null +++ b/.ci_support/requirements.yaml @@ -0,0 +1,13 @@ +name: staged-recipes +channels: +- conda-forge +dependencies: +- conda>=23.7.3 +- conda-libmamba-solver>=23.7.0 +- conda-build>=24.3 +- conda-index>=0.3.0 +- conda-forge-ci-setup>=4.9.3,<5.0 +- conda-forge-pinning +- frozendict +- networkx=2.4 +- rattler-build-conda-compat>=1.2.0,<2.0.0a0 diff --git a/.gitattributes b/.gitattributes index 5423d792ba24b..8833b12e52c6b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,5 @@ *.yaml text eol=lf *.sh text eol=lf *.bat text eol=crlf +# GitHub syntax highlighting +pixi.lock linguist-language=YAML linguist-generated=true diff --git a/.gitignore b/.gitignore index 84e75110340fd..e85e040bc4cae 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build_artifacts # Compiled Python code __pycache__ *.pyc +*.egg-info # Editor files *.swp diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 38d725f53f6ce..ed852481b9ecc 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -6,21 +6,20 @@ source .scripts/logging_utils.sh ( startgroup "Ensuring Miniforge" ) 2> /dev/null -MICROMAMBA_VERSION="1.5.10-0" -MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-osx-64" -MINIFORGE_ROOT="${MINIFORGE_ROOT:-${HOME}/Miniforge3}" +PIXI_VERSION="0.30.0" +PIXI_URL="https://github.com/prefix-dev/pixi/releases/download/v${PIXI_VERSION}/pixi-x86_64-apple-darwin" +MINIFORGE_ROOT="$CWD/.pixi/envs/default" if [[ -d "${MINIFORGE_ROOT}" ]]; then echo "Miniforge already installed at ${MINIFORGE_ROOT}." else - echo "Downloading micromamba %MICROMAMBA_VERSION%" - micromamba_tmp="$(mktemp -d)/micromamba" - curl -L -o "${micromamba_tmp}" "${MICROMAMBA_URL}" - chmod +x "${micromamba_tmp}" + echo "Downloading pixi ${PIXI_VERSION}" + pixi_tmp="$(mktemp -d)/pixi" + curl -L -o "${pixi_tmp}" "${PIXI_URL}" + chmod +x "${pixi_tmp}" echo "Creating environment" - "${micromamba_tmp}" create --yes --root-prefix ~/.conda --prefix "${MINIFORGE_ROOT}" \ - --channel conda-forge \ - --file .ci_support/requirements.txt + "${pixi_tmp}" init --import .ci_support/requirements.yaml --platform osx-64 + "${pixi_tmp}" install fi ( endgroup "Ensuring Miniforge" ) 2> /dev/null diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index c36cb28d2d12f..7ed49ff4f1662 100644 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -11,23 +11,22 @@ setlocal enableextensions enabledelayedexpansion call :start_group "Installing conda" -set "MICROMAMBA_VERSION=1.5.10-0" -set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-64" -set "MICROMAMBA_TMPDIR=%TMP%\micromamba-%RANDOM%" -set "MICROMAMBA_TMP=%MICROMAMBA_TMPDIR%\micromamba.exe" -if "%MINIFORGE_ROOT%"=="" ( - set "MINIFORGE_ROOT=%USERPROFILE%\Miniforge" -) - -echo Downloading micromamba %MICROMAMBA_VERSION% -if not exist "%MICROMAMBA_TMPDIR%" mkdir "%MICROMAMBA_TMPDIR%" -certutil -urlcache -split -f "%MICROMAMBA_URL%" "%MICROMAMBA_TMP%" +PIXI_VERSION="0.30.0" +PIXI_URL="https://github.com/prefix-dev/pixi/releases/download/v${PIXI_VERSION}/pixi-x86_64-pc-windows-msvc.exe" +set "PIXI_TMPDIR=%TMP%\pixi-%RANDOM%" +set "PIXI_TMP=%PIXI_TMPDIR%\pixi.exe" +set "MINIFORGE_ROOT=%CD%\.pixi\envs\default" + +echo Downloading pixi %PIXI_VERSION% +if not exist "%PIXI_TMPDIR%" mkdir "%PIXI_TMPDIR%" +certutil -urlcache -split -f "%PIXI_URL%" "%PIXI_TMP%" if errorlevel 1 exit 1 +echo Importing environment +call "%PIXI_TMP%" init --import .ci_support\requirements.yaml --platform win-64 +if errorlevel 1 exit 1 echo Creating environment -call "%MICROMAMBA_TMP%" create --yes --root-prefix "%USERPROFILE%\.conda" --prefix "%MINIFORGE_ROOT%" ^ - --channel conda-forge ^ - --file .ci_support\requirements.txt +call "%PIXI_TMP%" install if errorlevel 1 exit 1 call :end_group