Earlier quoted context omitted.
> you should just use virtualenv with pip This is the most insulting take in the ongoing ruination of Python. You used to be able to avoid virtualenvs and install scripts and dependencies directly runnable from any shell. Now you get endlessly chastised for trying to use Python as a general purpose utility. Debian was a bastion of sanity with the split between dist_packages and site_packages but that's ruined now too…
it's because so many essential system tools now rely on python, and if you install arbitrary code outside of a venv it can clobber the global namespace and break the core OS' guarantees. I do agree it is annoying, and what they need to do is just provide an automatic "userspace" virtualenv for anything a user installs themselves... but that is a pandoras box tbh. (Do you do it per user? How does the user become aware…
Uv is the best thing to happen to the Python ecosystem in a decade
571–580 of 1001 posts
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#572Earlier quoted context omitted.
On performance: 3.13 removed the GIL and added experimental first-party JIT (like PyPy). In two years I bet we’ll be seeing v8 level performance out of CPython.
The “Faster CPython” team were let go from Microsoft because they could only produce a 1.5x speedup in four years instead of the planned 5x. It’s wildly optimistic to now expect a 10x speedup in two years, with fewer resources.
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#573Earlier quoted context omitted.
Never underestimate cultural momentum I guess. NBA players shot long 2 pointers for decades before people realized 3 > 2. Doctors refused to wash their hands before doing procedures. There’s so many things that seem obvious in retrospect but took a long time to become accepted
They did wash their hands. Turns out that soap and water wasn't quite enough. Lister used carbolic acid (for dressing and wound cleaning) and Semmelweis used chlorinated lime (for hand washing).
But this is getting a bit off topic, I suppose.
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#574I must be the odd man out but I am not a fan of uv. 1. It tries to do too many things. Please just do one thing and do it well. It's simultaneously trying to replace pip, pyenv, virtualenv, and ruff in one command. 2. You end up needing to use `uv pip` so it's not even a full replacement for pip. 3. It does not play well with Docker. 4. It adds more complexity. You end up needing to understand all of these new enviro…
- resorting to logical fallacies, or
- relying on your unstated assumption that all complexity is bad
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#575 alias ytd="uv tool upgrade yt-dlp && yt-dlp"
Which is pretty cool.Re: Uv is the best thing to happen to the Python ecosystem in a decade
#576For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.
> The script now works like a standalone executable But whoever runs this has to install uv first, so not really standalone.
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#577Earlier quoted context omitted.
Webdev since 1998 here. Tabling the python vs JS/etc to comment on npm per se. PNPM is better than npm in every way. Strongest possible recommendation to use it instead of npm; it's faster, more efficient, safer, and more deterministic. See https://pnpm.io/motivation
Deno is pretty sweet too... shell scripts that don't need a package.json or a node_modules directory for dependencies.
Re: Uv is the best thing to happen to the Python ecosystem in a decade
#578Re: Uv is the best thing to happen to the Python ecosystem in a decade
#579For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.
> uv will magically install and use the specified modules. As long as you have internet access, and whatever repository it's drawing from is online, and you may get different version of python each time, ...