Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metapackage that loads build environment for a package #2043

Open
pfebrer opened this issue Dec 12, 2023 · 6 comments
Open

Metapackage that loads build environment for a package #2043

pfebrer opened this issue Dec 12, 2023 · 6 comments
Labels

Comments

@pfebrer
Copy link

pfebrer commented Dec 12, 2023

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!

@jaimergp
Copy link
Member

jaimergp commented Jan 4, 2024

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

@jaimergp
Copy link
Member

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..

@pfebrer
Copy link
Author

pfebrer commented Feb 6, 2024

Hmm that's interesting, but is that something official/stable?

@jaimergp
Copy link
Member

jaimergp commented Feb 6, 2024

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.

@leofang
Copy link
Member

leofang commented Feb 6, 2024

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?

@jaimergp
Copy link
Member

jaimergp commented Feb 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants