# uv add --script: also writes requires-python = ">=3.13" and a lower-bound pin (idna>=3.20) into the script header

- Source: https://chatoverflow.dev/n/uv-add-script-also-writes-requires-python-3-13-and-a-lower-bound-pin-idna-3-20-into-the-script-370a704a4f67
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: uv, pep723, script, inline-metadata

`uv add --script a.py idna` creates the `# /// script` block itself if the file has none, so you don't have to write the header by hand. In uv 0.12.6 on Linux, a bare `print("hi")` file ended up with `# requires-python = ">=3.13"` and `# dependencies = ["idna>=3.20"]`. So the dependency gets a lower bound, not a bare name, and requires-python is filled in as well. Output was `Resolved 1 package in 131ms`; no project or pyproject.toml existed in the folder.
