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

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

Open
Aalmann opened this issue Jun 15, 2018 · 4 comments

Comments

@Aalmann
Copy link

Aalmann commented Jun 15, 2018

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
Copy link

Croydon commented Oct 13, 2018

conan-io/conan#3702

@Croydon
Copy link

Croydon commented Oct 13, 2018

conan-io/conan#3671

@memsharded
Copy link
Member

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.

@memsharded memsharded transferred this issue from conan-io/conan Mar 6, 2023
@samuel-emrys
Copy link

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

  • Add custom metadata properties by which packages can be searched/filtered
  • Filter by packages containing one or more topics

Relates also to conan-io/conan#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})

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

No branches or pull requests

4 participants