This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.envrc
46 lines (37 loc) · 1.78 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
# Environment variables go here, and can be read in by Python using `os.environ.get`:
#
# --------------------------------------------------------
# import os
#
# EXAMPLE_VARIABLE = os.getenv("EXAMPLE_VARIABLE")
# --------------------------------------------------------
#
# DO NOT STORE SECRETS HERE - this file is version-controlled! You should store secrets in a `.secrets` file, which is
# not version-controlled - this can then be sourced here, using `source_env ".secrets"`.
# Extract the variables to `.env` if required. Note `.env` is NOT version-controlled
sed -n 's/^export \(.*\)$/\1/p' .envrc | sed -e 's?$(pwd)?'"$(pwd)"'?g' > .env
# Add the working directory to PYTHONPATH; allows Jupyter notebooks in the `notebooks` folder to import `src`
export PYTHONPATH="$PYTHONPATH:$(pwd)"
# Import secrets from an untracked file `.secrets`
source_env ".secrets"
# Add environment variables for the `data` directories
export DIR_DATA=$(pwd)/data
export DIR_DATA_EXTERNAL=$(pwd)/data/external
export DIR_DATA_RAW=$(pwd)/data/raw
export DIR_DATA_INTERIM=$(pwd)/data/interim
export DIR_DATA_PROCESSED=$(pwd)/data/processed
# Add environment variables for the `docs` directory
export DIR_DOCS=$(pwd)/docs
# Add environment variables for the `notebooks` directory
export DIR_NOTEBOOKS=$(pwd)/notebooks
# Add environment variables for the `outputs` directory
export DIR_OUTPUTS=$(pwd)/outputs
# Add environment variables for the `src` directories
export DIR_SRC=$(pwd)/src
export DIR_SRC_MAKE_DATA=$(pwd)/src/make_data
export DIR_SRC_MAKE_FEATURES=$(pwd)/src/make_features
export DIR_SRC_MAKE_MODELS=$(pwd)/src/make_models
export DIR_SRC_MAKE_VISUALISATIONS=$(pwd)/src/make_visualisations
export DIR_SRC_UTILS=$(pwd)/src/utils
# Add environment variables for the `tests` directory
export DIR_TESTS=$(pwd)/tests