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

How do I use arguably with functions scattered across different modules? #27

Open
sg-s opened this issue Nov 21, 2024 · 3 comments
Open

Comments

@sg-s
Copy link

sg-s commented Nov 21, 2024

Let's say I have two modules:

.
├── __init__.py
│   ├── module1.py
│   ├──module2.py

and module1 and module2 have various functions i want to wrap with @arguably.run

i'd like module1 and module2 to appear as subcommands to my main command, and the functions inside them to be subcommands inside the subcommands. is this possible?

@treykeown
Copy link
Owner

Commands aren't separated by module. Right now, the only way to achieve what you'd want is to prefix all functions in module1 with module1__ and the same for module2.

I'll also add a name override to the @arguably.command decorator - that way, you won't have to rename your functions.

@sg-s
Copy link
Author

sg-s commented Nov 21, 2024

I'll also add a name override to the @arguably.command decorator - that way, you won't have to rename your functions.

can you tell me mow on how to do this?

also i'm still a little fuzzy on how i set up the entrpoint when i have commands in 2+ modules

@sg-s
Copy link
Author

sg-s commented Nov 21, 2024

also happy to help/contribute -- let me know!

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

2 participants