Is there a way to have platform-specific dependencies in environment.yml?

The "dummy packages" are actually called "metapackages". See http://conda.pydata.org/docs/building/meta-pkg.html. That seems a good option.

Alternatively, could you build a conda package of your project? In the conda recipe's meta.yml you can use selectors for different platforms. http://conda.pydata.org/docs/building/meta-yaml.html#preprocessing-selectors


I stumbled across the same problem and wrote a small parser for exactly this problem. In your case, you could create an environment.yml.meta file as follows:

name: demo_env
dependencies:
  - <your_other_dependencies>
  - libgfortran [platform startswith linux]
  - openssl     [platform startswith linux]

and then create the environment from it with

python create_env.py

It's of course not the same as if it was supported native, because you need to either add the parser as submodule to your repo or just copy it over, but maybe you find it useful. The project is on GitHub:

https://github.com/silvanmelchior/cme_parser