Skip to content

Commit

Permalink
Same but with pixi
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 2, 2024
1 parent c344fcf commit af04d0a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 33 deletions.
21 changes: 12 additions & 9 deletions .ci_support/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions .ci_support/requirements.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build_artifacts
# Compiled Python code
__pycache__
*.pyc
*.egg-info

# Editor files
*.swp
Expand Down
19 changes: 9 additions & 10 deletions .scripts/run_osx_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 13 additions & 14 deletions .scripts/run_win_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af04d0a

Please sign in to comment.