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

Hatch's run command is removing braces from sub-commands #1896

Open
kgoehner opened this issue Jan 27, 2025 · 0 comments
Open

Hatch's run command is removing braces from sub-commands #1896

kgoehner opened this issue Jan 27, 2025 · 0 comments

Comments

@kgoehner
Copy link

Example python executable file, test.py:

import click

@click.command()
@click.argument('filename')
def test(filename):
    print(f"Received: {filename}")

if __name__ == '__main__':
    test()

If you open a hatch environment, hatch shell and run python test.py example_{{template}}.py, this will output the expected string, "Received: example_{{template}}.py". But if you run this with hatch run it will output "Received: example_{template}.py".

Is this an expected behavior? This was a surprising behavior for me, and it feels like hatch should be escaping parameters before calling python's string formatter on them or communicating this behavior in the docs.

Command to reproduce the issue: hatch run python test.py example_{{template}}.py on the above file.

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

1 participant