Choose packaging environment in Binder

My project supports installation through conda and through pip by providing an environment.yaml file and a requirements.txt file. I noticed that Binder selects pip in that case. Is it because .yaml is not recognized, only .yml? Apart from the extension, can I define somewhere that Binder should use conda and not pip?

Hi! You’re right about the extension, I think. If you’d like to force binder to only use the environment.yml file, you can place it inside a .binder or binder directory in the root of your project. Binder will then ignore any other configuration files that are in the root. https://repo2docker.readthedocs.io/en/latest/usage.html#where-to-put-configuration-files

3 Likes

Thanks! Creating a .binder directory and putting the environment.yml file solved the issue. For curiosity, I tried .yaml. That did not work. Interestingly, ReadTheDocs identifies both the .yaml and the .yml extensions.

Yes, I just opened this issue to discuss it some more https://github.com/jupyterhub/repo2docker/issues/970

Can you provide a link to where in the docs it says both extensions are accepted please?

repo2docker does not state that .yaml is accepted. What I referred to was ReadTheDocs, which does allow .yaml.
To me, accepting .yaml is not a big issue, I just reported it that you know about it.

1 Like

Oh sorry! Because we build our documentation with RTD, I thought you were referring to our r2d or binder docs - not literally RTD! :joy:

It’s probably not a big deal, but we could do something like a pre-build check and provide some feedback along the lines of “are you sure this is correct?” - make it a little less painful to figure out why something is broken

1 Like