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] Allow custom commands to reuse code from other ones #13942

Closed
1 task done
danimtb opened this issue May 23, 2023 · 0 comments · Fixed by #13944
Closed
1 task done

[feature] Allow custom commands to reuse code from other ones #13942

danimtb opened this issue May 23, 2023 · 0 comments · Fixed by #13944
Assignees
Milestone

Comments

@danimtb
Copy link
Member

danimtb commented May 23, 2023

What is your suggestion?

When developing custom commands, it is very likely that you would have to repeat some code and share it with other commands.

To do show, it will be nice to alllow importing code from other files (other custom commands) as python modules. This is not possible currently, as you can see here: conan-io/conan-extensions#45

So, as example, the expected feature would be:

cmd_build_info.py

...
from cmd_server import read_servers


@conan_subcommand()
def property_set(conan_api: ConanAPI, parser, subparser, *args):
    """
    Set properties for artifacts under a Conan reference recursively.
    """
    servers = read_servers()
    ....

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
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

Successfully merging a pull request may close this issue.

2 participants