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

task_params does not work when using basename #434

Open
frozax opened this issue Jul 31, 2022 · 1 comment
Open

task_params does not work when using basename #434

frozax opened this issue Jul 31, 2022 · 1 comment
Labels

Comments

@frozax
Copy link

frozax commented Jul 31, 2022

Hi,

The task_params decorator does not work when the task is using basename. The parameters are detected, but not replaced in the task parameter in python.

dodo.py

from doit import task_params

@task_params([{"name": "param", "short": "p", "long": "param", "default": "default"}])
def task_test1(param):
    return { 'actions':[f"echo task_test1 {param}"] }

@task_params([{"name": "param", "short": "p", "long": "param", "default": "default"}])
def task_test2(param):
    return { 'basename': 'test_other', 'actions':[f"echo task_test2 {param}"] }

Execution

> doit -v2 test1 --param p1 test_other --param p2
.  test1
task_test1 p1
.  test_other
task_test2 default

Execution 2

> doit -v2 test_other --invalid p2
ERROR: Error parsing Task: option --invalid not recognized (parsing options: [CmdOption({'name':'param', 'short':'p','long':'param' })]). Got: ['--invalid', 'p2']

Environment

  1. OS: Windows 10
  2. python version: 3.7.3
  3. doit version: 0.34.2
Fund with Polar
@tom-varga
Copy link

tom-varga commented Jul 31, 2022 via email

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

No branches or pull requests

3 participants