-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·31 lines (23 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Thanks to http://blog.ianpreston.ca/2020/05/13/conda_envs.html for working some of this out!
# Oneshell means all lines in a recipe run in the same shell
.ONESHELL:
# Need to specify bash in order for conda activate to work
# SHELL=/bin/bash
# Note that the extra activate is needed to ensure that the activate floats env to the front of PATH
CONDA_ACTIVATE=source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate
# source $(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate cg_env
# Same name as in environment.yml
CONDA_ENV=cg_env
all: conda-env-update pip-compile pip-sync
# Create or update conda env
conda-env-update:
conda env update --prune
echo "!!!RUN RIGHT NOW:\nconda activate $(CONDA_ENV)"
# Compile exact pip packages
pip-compile:
$(CONDA_ACTIVATE) $(CONDA_ENV)
pip-compile -v requirements/prod.in && pip-compile -v requirements/dev.in
# Install pip packages
pip-sync:
$(CONDA_ACTIVATE) $(CONDA_ENV)
pip-sync requirements/prod.txt requirements/dev.txt