* A recently-published PEP specificies how Python scripts can declare dependencies in opening comments.
* uv is a Python script-runner/package manager which scans for those dependencies, arranges for them to be met, and runs the script with those dependency modules available for importing
* If, in a Python script, you use the first line comment - the shebang line - to have the file invoked using uv rather than python itself, you'll get that effect automagically when "running" the Python script
The result: Python scripts which require setup of dependencies will now "just run".
https://akrabat.com/defining-python-dependencies-at-the-top-of-the-file/
I highly recommend it over all conceivable alternatives.
I read the same sentiment about poetry a few years ago. Turns out tools that do one thing well are better in the long run.
it's the same for uv/pip/poetry except uv is so much better than the alternatives there isn't any contest. pip is the safe default (which doesn't even work out of the box on debian derivatives, which is half the issue) and uv is... just default.
I did eventually figure out I could just do `corepack pnpm setup` then install packages globally with pnpm.