OpenWPM/scripts/repin.sh

47 строки
1.3 KiB
Bash
Исходник Обычный вид История

2020-05-14 02:12:30 +03:00
#!/bin/bash
# This script re-creates environment.yaml
# This script will remove an existing openwpm
# mamba environment if it exists.
2020-05-14 02:12:30 +03:00
set -e
# Make mamba available to shell script
2020-05-14 02:12:30 +03:00
eval "$(conda shell.bash hook)"
# Create openwpm env with unpinned yaml file
# `PYTHONNOUSERSITE` set so python ignores local user site libraries when building the env
2021-12-20 18:47:32 +03:00
# See: https://github.com/openwpm/OpenWPM/pull/682#issuecomment-645648939
case "$(uname -s)" in
Darwin)
echo 'Using the osx-64 channel for MacOS dependencies...'
CONDA_SUBDIR=osx-64 PYTHONNOUSERSITE=True mamba env create --force -q -f environment-unpinned.yaml
;;
*)
PYTHONNOUSERSITE=True mamba env create --force -q -f environment-unpinned.yaml
;;
esac
2020-05-14 02:12:30 +03:00
# Activate
conda activate openwpm
2020-05-14 03:10:15 +03:00
# Adding dev dependencies to environment
case "$(uname -s)" in
Darwin)
echo 'Using the osx-64 channel for MacOS dependencies...'
CONDA_SUBDIR=osx-64 PYTHONNOUSERSITE=True mamba env update -f environment-unpinned-dev.yaml
;;
*)
PYTHONNOUSERSITE=True mamba env update -f environment-unpinned-dev.yaml
;;
esac
2020-05-14 03:10:15 +03:00
2020-05-14 02:12:30 +03:00
# Export the environment including manually specify channels
mamba env export --no-builds --override-channels -c conda-forge -c main -f ../environment.yaml
2020-05-14 02:12:30 +03:00
# Prune environment file to only things we want to pin
python prune-environment.py
2020-05-14 02:12:30 +03:00
echo 'New environment.yaml successfully created.'