Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Conda: Add "track_features" and "app_own_environment" to repodata.json output(s)
-
First of all; we've been using ProGet for our more-and-more internal package distribution for more than a year now, and pretty happy about it!
I recently tried to add some more metadata to a package, but two items are not taken over by ProGet: "track_features" and "app_own_environment". The first is simply a string, the second is a boolean. Both are available in a conda package's "index.json" file.
Can these be added? Thanks!
-
Glad to hear it!
Our only exposure to the Conda ecosystem is writing a feed for it, so hope you don't mind a few "dumb" questions :)
Are there any official/public packages (from like the anaconda repository) that have this field? I presume those would also be in their index.
Any idea where these might be officially documented? I found a reference in the meta.yaml specs, but you said "json" and that's clearly "yaml". I figure maybe it turns into a json at some point.
Are there any similar fields? I see we parse a bunch of fields, like
constrains
todev_url
.Cheers,
Alana
-
A good example for "track_features" is this package: https://anaconda.org/main/_low_priority, which directly explains the idea of "track_features": packages that "activate" features (either because they have "track_features" specified themselves or because their dependencies do so) will get a lower priority. The attribute is useful when you have a GPU build and a CPU build of the same package, and you want to prioritize one over the other.
In our case, we wish to do exactly that: use track_features to prioritize a CPU version of a certain package over a GPU version because the former runs on any PC, while the latter only works with a proper GPU available.
Some additional reading material is here: https://docs.conda.io/projects/conda/en/stable/user-guide/concepts/packages.html#track-features
In any case, the "track_features" attribute can be found in the
index.json
file that is in a conda package.About the
meta.yaml
: that is a specification/configuration when building a package. The build process then generates theindex.json
file (and theabout.json
) and puts it in the package (under theinfo
folder) for repositories to extract useful information from. I think that for ProGet, theindex.json
is more important than theabout.json
.Finally, this method gives a quite complete overview of all keys that may be in the index.json. They are not all neccessarily there, though. Here is the method/code:
https://github.com/conda/conda-build/blob/8df6493565dae517165754bd75d7d74de1522dc3/conda_build/metadata.py#L1803Hope this helps!
-
Thanks @e-rotteveel_1850 !
This is super-helpful indeed, especially the package that has that metadata.
Do you have an example package that is emitting
app_own_environment
in the index repo? It looked like it was handled slightly differently in theconda-build
code you found, and might be a nested property.. or something. It also seems to be a bool.It isn't trivial to add fields but also not terribly complicated. I added an item PG-2876 that we hope to get in the Feb 7 maintenance release, but might get pushed back.
Let us know if you're aware of a
app_own_environment
package as well, that really helps to test this. We likely will not use conda, but simply verify json/index data.
-
Thanks for putting this on the issue tracker!
As for "app_own_environment": I only found it in the sourcecode of Anaconda Navigator - a GUI package manager for conda environments. It seems a useful feature but I cannot find any other package that uses it.
So if you cannot add "app_own_environment" without having extra info, you can just leave it out. It was just a nice-to-have.
Looking forward to a new version with "track_features" added to the index output!
-
We've added both of these properties to the index - you should see them in this week's release of 2024.26 on Friday. Thanks for the feature request!