conan-io / conan-extensions

Some extra Conan commands for different purposes, like artifactory tasks, conan-center-index, etc
MIT License
28 stars 26 forks source link

[feature request] Add meta-data (label, tags, properties) to recipe and published packages for better search #5

Open Aalmann opened 6 years ago

Aalmann commented 6 years ago

Hi @memsharded and @lasote

this is a new feature request which would make things easier to find.

Basics

As I have seen, one can set properties for meta-data in Artifactory. Currently this is only available in pro version and I'm currently not sure if they already can be set automatically by conan. And I'm also not sure, if one can use these properties in a conan search command (e.g. in query). I didn't find any reference for that, so I think it's not.

Idea

So the idea / feature request is, that conan should provide a way, to define meta data in a recipe and/or command line, which will automatically set properties in Artifactory. If so, the user would be able to have additional filter when searching for packages.

Use case/example

The user is looking for a package (library) which can process XML data but the user does not know the (exact) name of the library. And probably there are more than just one library which can do this (there are a lot of libs who can do that). So the user wants to search for all stable packages which have the label/tag/property (no idea what could be the best term for that) "xml" or "xml*". The command could look like this

conan search * [-r my-remote] -q "property=xml*"

which would list all (remote-)packages where the property is "xml" or everything else starting with "xml".

Best Aalmann

Croydon commented 5 years ago

https://github.com/conan-io/conan/pull/3702

Croydon commented 5 years ago

https://github.com/conan-io/conan/issues/3671

memsharded commented 1 year ago

This didn't get traction as a built-in feature, but I am moving this to the conan-extensions repo, because there there will be commands to set and read artifactory properties for recipes and packages.

samuel-emrys commented 1 year ago

+1 for this, it would be good to be able to:

Relates also to https://github.com/conan-io/conan/issues/5661, which proposed a potential implementation of this (for conan 1.x):

import argparse
from conans.client import conan_api

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('topic', type=str)
    args = parser.parse_args()
    conan, _, _ = conan_api.Conan.factory()
    recipes = conan.search_recipes(None)
    for recipe in recipes["results"][0]["items"]:
        recipe = recipe["recipe"]["id"]
        attributes = conan.inspect(recipe, attributes=["topics"])
        if attributes["topics"] is not None and args.topic in attributes["topics"]:
            print(recipe})