2020-05-14 02:12:30 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script re-creates environment.yaml
|
|
|
|
# This script will remove an existing openwpm
|
2023-01-19 09:23:11 +03:00
|
|
|
# mamba environment if it exists.
|
2020-05-14 02:12:30 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-01-19 09:23:11 +03:00
|
|
|
# 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
|
2020-06-23 01:29:44 +03:00
|
|
|
# `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
|
2023-01-19 09:23:11 +03:00
|
|
|
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
|
|
|
|
2020-05-14 08:14:30 +03:00
|
|
|
# Activate
|
|
|
|
conda activate openwpm
|
|
|
|
|
2020-05-14 03:10:15 +03:00
|
|
|
# Adding dev dependencies to environment
|
2023-01-19 09:23:11 +03:00
|
|
|
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
|
2023-01-19 09:23:11 +03:00
|
|
|
mamba env export --no-builds --override-channels -c conda-forge -c main -f ../environment.yaml
|
2020-05-14 02:12:30 +03:00
|
|
|
|
2020-05-14 08:14: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.'
|