Skip to content

Commit

Permalink
[FIX] fix conda config
Browse files Browse the repository at this point in the history
  • Loading branch information
SSooop committed Feb 7, 2025
1 parent 70b4877 commit 24d07f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 23 deletions.
24 changes: 4 additions & 20 deletions .ci/autosetup.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
#!/bin/bash

# check environment-full.yml
ENV_PREFIX="$WORKSPACE/env"
ENV_YAML="$WORKSPACE/environment-full.yml"
ENV_CACHE_YAML="$WORKSPACE/env/environment-full.yml"
if [ ! -f $ENV_YAML ]; then
echo "$ENV_YAML is not found."
exit 1
fi

# update env
if diff --brief <(cat $ENV_CACHE_YAML 2>/dev/null) <(cat $ENV_YAML); then
echo "Environment is up to date"
else
if [ -d ./env ]; then
echo "Environment is out of date, removing old environment"
rm -rf ./env
fi
echo "Creating new environment"

conda config --show && \
conda config --set always_yes yes && \
conda clean -i && \
conda env create -p $ENV_PREFIX -f $ENV_YAML && \
conda activate $ENV_PREFIX && \
source scripts/install_pyrosys_conda.sh --dev --ci && \
cp $ENV_YAML $ENV_CACHE_YAML
fi
conda config --show && \
conda config --set always_yes yes && \
conda clean -i && \
source scripts/install_pyrosys_conda.sh --dev --ci
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build-env
activate-environment: pyrosys-dev

- name: Build
shell: bash -el {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build-env
activate-environment: pyrosys-dev

- name: Setup Environment
shell: bash -el {0}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_pyrosys_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fi
if [ "$DEV_MODE" -eq 0 ]; then
conda env update -f environment.yml
elif [ "$CI_MODE" -eq 1 ]; then
conda env update -f environment-full.yml -p $ENV_PREFIX -q
conda env update -f environment-full.yml -q
else
conda env update -f environment-full.yml
fi
Expand Down

0 comments on commit 24d07f2

Please sign in to comment.