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] Implicit print #61

Closed
XF-FW opened this issue Apr 26, 2022 · 5 comments
Closed

[Feature request] Implicit print #61

XF-FW opened this issue Apr 26, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@XF-FW
Copy link

XF-FW commented Apr 26, 2022

Hello there,

I'm trying to add something like this:

# pyproject.toml (lines 48-49)
[tool.poe.tasks]
get_random_secret_key = { script = "django.core.management.utils:get_random_secret_key()" }

The function however, returns a string and does not print its result. Would it be possible to have an option to print the return values of a given function?

Thank you.

@ThatXliner
Copy link
Contributor

Changing

f"import_module('{target_module}').{function_call}",
should be sufficient

@XF-FW
Copy link
Author

XF-FW commented Apr 26, 2022

Sounds about right and I wouldn't mind contributing with a PR, but I'm not sure on how I should handle the configuration.

@ThatXliner
Copy link
Contributor

The title of this issue is “implicit print” so maybe you would like it to print the return value if the return value is not None

how I should handle the configuration.

I believe it’s self.options? Not too sure but you should try that

@nat-n
Copy link
Owner

nat-n commented Apr 27, 2022

Hi @XF-FW, thanks for the feedback.

I see how that would be useful. I would accept a PR to enable something along the lines of:

[tool.poe.tasks]
get_random_secret_key = { script = "django.core.management.utils:get_random_secret_key()", print_result = true }

Check the contributing guide. You'll need to register an option for the script task type (see how it's done for the sequence task type) and a test case here.

@nat-n nat-n added the enhancement New feature or request label Jun 18, 2022
@nat-n nat-n self-assigned this Jul 17, 2022
@nat-n
Copy link
Owner

nat-n commented Jul 17, 2022

I've implemented this feature on the development branch and it will be included in the next release.

@nat-n nat-n closed this as completed Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants