<jupyter_start><jupyter_text>Conda Environments  Imports<jupyter_code>import os
from os.path import dirname<jupyter_output><empty_output><jupyter_text>InitializationSome important variables to be used afterwards.<jupyter_code>name = "dummynator"

root_dir = dirname(dirname(os.getcwd()))

fn_conda_dep = 'dependencies-deploy.yaml'
fn_conda_dev = 'dependencies-develop.yaml'<jupyter_output><empty_output><jupyter_text>IntroductionThis cookiecutter is set up for optimal use with conda, for local dependency managment. The takeaway is this; for local dependency managment, we rely on conda and nothing else.Note that this has nothing to do with remote dependency managment. This is what you need to take care of when preparing a release of your code which goes via PyPi or alternatives. We treat that as an independent problem. Mixing remote and local dependency managment tends to add complexity instead of removing it.  WorkflowWe distinguish between `deployment` and `development` environments. Of course, in research this is not always that useful or clear. We follow this rule of thumb:```Everything that should end up in pip release, goes in deployment```Which still justifies keeping the two separated.  Deployment EnvironmentThis environment is whatever an end user may need in order to use your package.<jupyter_code>%%bash -s "$name" "$root_dir" "$fn_conda_dep"

source ~/.bashrc

conda env list
%%bash -s "$name" "$root_dir" "$fn_conda_dep"

source ~/.bashrc

cd $2

conda env create -f $3 -n $1<jupyter_output>Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

Downloading and Extracting Packages
python-3.7.6         | 44.9 MB   | ########## | 100% 
_libgcc_mutex-0.1    | 3 KB      | ########## | 100% 
joblib-0.14.1        | 201 KB    | ########## | 100% 
wheel-0.33.6         | 42 KB     | ########## | 100% 
python-dateutil-2.8. | 224 KB    | ########## | 100% 
pyparsing-2.4.6      | 64 KB     | ########## | 100% 
six-1.13.0           | 26 KB     | ########## | 100% 
ld_impl_linux-64-2.3 | 568 KB    | ########## | 100% 
jedi-0.15.2          | 743 KB    | ########## | 100% 
parso-0.5.2          | 69 KB     | ########## | 100% 
decorator-4.4.1      | 13 KB     | ########## | 100% 
pygments-2.5.2       | 672 KB    | ########## | 100% 
certifi-2019.11.28   | 153 KB    | ########## | 100% 
traitlets-4.3.3      | 140 KB    | ########## | 100% 
prompt_toolkit-3.0.2 | 234 KB    | ########## | 100% 
ipython-7.11.1       | 974 KB    | ########## | 1[...]<jupyter_text>Development environment<jupyter_code>%%bash -s "$name" "$root_dir" "$fn_conda_dev"

source ~/.bashrc

cd $2

conda activate $1

conda env update -n $1 -f $3<jupyter_output>Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Please add an explicit pip dependency.  I'm adding one for you, but still nagging you.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

Downloading and Extracting Packages
testpath-0.4.4       | 88 KB     | ########## | 100% 
prometheus_client-0. | 42 KB     | ########## | 100% 
jupyter_core-4.6.1   | 70 KB     | ########## | 100% 
jupyterlab_server-1. | 26 KB     | ########## | 100% 
packaging-20.0       | 35 KB     | ########## | 100% 
zipp-0.6.0           | 9 KB      | ########## | 100% 
jinja2-2.10.3        | 95 KB     | ########## | 100% 
nbconvert-5.6.1      | 459 KB    | ########## | 100% 
importlib_metadata-1 | 46 KB     | ########## | 100% 
defusedxml-0.6.0     | 23 KB     | ########## |[...]<jupyter_text>Jupyter kernelExpose the environment to your jupyter.<jupyter_code>%%bash -s "$name" "$root_dir" "$fn_conda_dep"

source ~/.bashrc

cd $2

conda activate $1
python -m ipykernel install --user --name $1 --display-name "$1"<jupyter_output>Installed kernelspec dummynator in /home/elia/.local/share/jupyter/kernels/dummynator
{'fraction_non_alphanumeric': 0.1651036525172754, 'fraction_numerical': 0.0562685093780849, 'mean_word_length': 3.2618296529968456, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '410547', 'license': 'MIT', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1360, 'n_words': 420, 'path': 'note/deploy/conda.ipynb', 'repo_name': 'eliavw/dummynator', 'size': '4052'}