uv/docs/guides
tfsingh 6e9ecde9c2
Add support for uv init --script (#7565)
This PR adds support for ```uv init --script```, as defined in issue
#7402 (started working on this before I saw jbvsmo's PR). Wanted to
highlight a few decisions I made that differ from the existing PR:

1. ```--script``` takes a path, instead of a path/name. This potentially
leads to a little ambiguity (I can certainly elaborate in the docs,
lmk!), but strictly allowing ```uv init --script path/to/script.py```
felt a little more natural than allowing for ```uv init --script path/to
--name script.py``` (which I also thought would prompt more questions
for users, such as should the name include the .py extension?)
2. The request is processed immediately in the ```init``` method,
sharing logic in resolving which python version to use with ```uv add
--script```. This made more sense to me — since scripts are meant to
operate in isolation, they shouldn't consider the context of an
encompassing package should one exist (I also think this decision makes
the relative codepaths for scripts/packages easier to follow).
3. No readme — readme felt a little excessive for a script, but I can of
course add it in!

---------

Co-authored-by: João Bernardo Oliveira <jbvsmo@gmail.com>
2024-09-25 22:48:01 +00:00
..
integration Bump version to 0.4.16 (#7669) 2024-09-24 14:39:21 -05:00
index.md Add FastAPI guide to overview (#6603) 2024-08-25 13:11:10 +00:00
install-python.md docs: add missing console highlights (#6900) 2024-08-31 19:04:19 -04:00
projects.md Note that uv lock --upgrade-package retains locked versions (#7694) 2024-09-25 22:17:55 +00:00
publish.md Implement trusted publishing (#7548) 2024-09-24 16:07:20 +00:00
scripts.md Add support for uv init --script (#7565) 2024-09-25 22:48:01 +00:00
tools.md docs: made uvx note more explict (#6546) 2024-08-23 17:17:37 -05:00