You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add any package available from conda, add it to the end of the list. If you have a PYPI dependency that's not avaible via conda, add it to the list of pip installable dependencies under ` - pip:`.
108
109
109
-
You can include any {{ cookiecutter.upstream_location }} python-based project in the `pip` section via `git+https://{{ cookiecutter.upstream_location }}/<my_git_handle>/<package>`.
110
+
You can include any `{{ cookiecutter.upstream_location }}` python-based project in the `pip` section via `git+https://{{ cookiecutter.upstream_location }}/<my_git_handle>/<package>`.
110
111
111
112
In particular, if you're working off of a fork or a work in progress branch of a repo in {{ cookiecutter.upstream_location }} (say, your personal version of <package>), you can change `git+https://{{ cookiecutter.upstream_location }}/<my_git_handle>/<package>` to
112
113
@@ -117,6 +118,43 @@ Once you're done your edits, run `make update_environment` and voila, you're upd
117
118
118
119
To share your updated environment, check in your `environment.yml` file. (More on this in [Sharing your Work](sharing-your-work.md))
119
120
121
+
#### Adding packages from other conda channels
122
+
Say we want to add a package only available from the `conda-forge` conda channel and not the default conda channel. (The conda channel is what follows `-c` when using `conda install -c my-channel my-package`. Suppose we want to use `make` on windows. Then we need to use `conda-forge` since the default conda channel only has linux and macOS installations of `make`. To normally conda install this, we would use `conda install -c conda-forge make`. **We won't do that here**.
123
+
124
+
Instead, we add a `channel-order` section that starts with `defaults` and lists the other channels we want to use in the order we want to install from them (note that this is a custom EasyData section to the `environment.yml`). Then we add our package in the dependency list in the form `channel-name::package-name`, for example, `conda-forge::make`.
125
+
126
+
In this case an updated `environment.yml` file looks like this:
127
+
```
128
+
name: {{ cookiecutter.repo_name }}
129
+
channel-order:
130
+
- defaults
131
+
- conda-forge
132
+
dependencies:
133
+
- pip
134
+
- pip:
135
+
- -e . # conda >= 4.4 only
136
+
- python-dotenv>=0.5.1
137
+
- nbval
138
+
- nbdime
139
+
- umap-learn
140
+
- gdown
141
+
- setuptools
142
+
- wheel
143
+
- git>=2.5 # for git worktree template updating
144
+
- sphinx
145
+
- bokeh
146
+
- click
147
+
- colorcet
148
+
- coverage
149
+
- coveralls
150
+
- datashader
151
+
- holoviews
152
+
- matplotlib
153
+
- jupyter
154
+
- conda-forge::make
155
+
...
156
+
```
157
+
120
158
121
159
#### Lock files
122
160
Now, we'll admit that this workflow isn't perfectly reproducible in the sense that conda still has to resolve versions from the `environment.yml`. To make it more reproducible, running either `make create_environment` or `make update_environment` will generate an `environment.{$ARCH}.lock.yml` (e.g. `environment.i386.lock.yml`). This file keeps a record of the exact environment that is currently installed in your conda environment `{{ cookiecutter.repo_name }}`. If you ever need to reproduce an environment exactly, you can install from the `.lock.yml` file. (Note: These are architecture dependent).
0 commit comments