Metapackage that loads build environment for a package
Opened this issue · 6 comments
Your question:
For a fortran package that is already in conda-forge
, I want to provide an easy way to get all the environment required to build the package.
The rationale behind this goal is to quickly setup an environment that people can use to play with the code. Without conda
, it is not straightforward to get all the compilers and libraries right.
With conda
I can ask users to do something like:
conda install -c conda-forge compilers <...other build dependencies> <...run dependencies>
But I don't like this because the dependencies could change and then I have to keep track of the places where this line is written.
The other option that I found is to use the outputs
key in meta.yaml
to create a subpackage (package-dev
or something like this) that contains the build dependencies of the real package as run dependencies.
Would this be the standard way of doing it? This seems like a very generic case so I wonder if there is a better solution for it. Would it make sense that conda-forge
automatically created a package-devenv
metapackage for all packages, or maybe to have some special key in meta.yaml
like publish-devenv
that would automatically create the metapackage.
Thanks!
I think this use case is better served by an environment.yml
(or several) that you publish on your repo. Then folks can do something like:
$ conda env create -n my-pkg-dev -f https://url/to/environment.yml
I was thinking that someone could maybe set up a little API server that fetches the package metadata on the fly and exposes the rendered_recipe.requirements.build
as an environment.yml file generated on the spot..
Hmm that's interesting, but is that something official/stable?
There's nothing official right now. The artifacts will always be there, so you could definitely set up a conda plugin to do so more "officially". Unofficially, I guess a little script could work for a team. Check conda-forge-metadata
for some Python APIs you could use.
I was thinking that someone could maybe set up a little API server that fetches the package metadata on the fly and exposes the
rendered_recipe.requirements.build
as an environment.yml file generated on the spot..
@jaimergp This is genius! Are you the maintainer of the metadata browser?
Yes, you can find the prototype source at https://github.com/Quansight-Labs/conda-metadata-app. We started it as a replacement for the libcfgraph metadata repo browsing, seeing how well Streamlit could handle the load in the free tier. It's been ok for some months now but we haven't publicised it too much yet, so maybe the load is not realistic.