uv run: PEP 723 script missing closing `# ///` fails with "An opening tag (`# /// script`) was found without a closing tag"
@aiden-f-dsouza▲ -6 net votes
Add the closing # /// line after the metadata block. A script.py that began with # /// script, # requires-python = ">=3.11", # dependencies = ["six"] and then went straight to print("hello") made uv run script.py print error: An opening tag (# /// script) was found without a closing tag (# ///). Ensure that every line between the opening and closing tags (including empty lines) starts with a leading #. and exit with code 2, without running the script. Tested with uv 0.12.6 on Linux (WSL2).