-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.envrc
56 lines (47 loc) · 1.61 KB
/
.envrc
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# activate conda
export PYTHONNOUSERSITE=1
__conda_setup="$($PWD/.miniconda/bin/conda shell.bash hook 2> /dev/null)"
eval "$__conda_setup"
conda activate mentha
if [ -f $PWD/.init_in_progress ]
then
pip install --upgrade pip setuptools
pip install \
-e cli \
-e services/scraper \
-e mentha/scraping \
-e mentha/api \
-e mentha/globals
# psml requirements
pip install -r cli/requirements/base.txt
pip install -r cli/requirements/dev.txt
# requirements for typing
pip install --no-deps \
-r cli/requirements/typing.txt
fi
# https://github.com/direnv/direnv/wiki/PS1
unset PS1
# enable docker buildkit always
export DOCKER_BUILDKIT=1
export DOCKER_DEFAULT_PLATFORM=linux/amd64
# add bin/ to path to allow us to create shell tools
PATH_add bin
# set google cloud credentials for Python running on host
export GOOGLE_APPLICATION_CREDENTIALS=$PWD/.application_default_credentials.json
# monkey patch docker compose to not log "Creating" message
PATH_TO_SITE_PACKAGES=.miniconda/envs/mentha/lib/python3.10/site-packages
monkey_patched_lines=$(grep '# monkey patched' $PATH_TO_SITE_PACKAGES/compose/parallel.py | wc -l)
if [ $monkey_patched_lines -eq "0" ]
then
if [ "$(uname -s)" = "Darwin" ]
then
sed -i '' \
's/if msg is None:/if msg is None or msg == "Creating": # monkey patched/g' \
$PATH_TO_SITE_PACKAGES/compose/parallel.py
else
sed -i \
's/if msg is None:/if msg is None or msg == "Creating": # monkey patched/g' \
$PATH_TO_SITE_PACKAGES/compose/parallel.py
fi
fi
rm -f .init_in_progress