HNHacker News
TopNewBestAskShowJobs

collinmanderson

2,545 karma · joined September 26, 2014

submissionscomments
collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
uv is finally an all-in-one tool that finally takes all of the good ideas from previous projects and combines them together to work well as one (and unbelievably fast).

The fact that it's a binary, not written in python, also simplifies bootstrapping. So you don't need python+dependencies installed in order to install your python+dependencies.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
I agree flake8 -> ruff was more of a game changer for me than pip+venv -> uv. I use flake8/ruff for more often than pip/venv.

uv is probably much more of a game changer for beginner python users who just need to install stuff and don't need to lint. So it's a bigger deal for the broader python ecosystem.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> The whole point of an environment manager is set the environment so that the commands I run work. They need to run natively how they are supposed to when the environment is set, not put through a translation layer.

The `uv run` command is an optional shortcut for avoiding needing to activate the virtual environment. I personally don't like the whole "needing to activate an environment" before I can run commands "natively", so I like `uv run`. (Actually for the last 10 years I've had my `./manage.py` auto-set up the virtual environment for me.)

The `uv add` / `uv lock` / `uv sync` commands are still useful without `uv run`.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> I really don't understand why you can't just pip install something globally. I want this package to be available to me EVERYWHERE, why can't I do it? I only use python recreationally because everyone uses python everywhere and you can't escape it. So there is a massive possibility I am simply wrong and pip-installing something globally is a huge risk. I'm just not understanding it.

You may have a library that's been globally installed, and you have multiple projects that rely on it. One day you may need to upgrade the library for use in one project, but there are backward incompatibile changes in the upgrade, so now all of your other projects break when you upgrade the global library.

In general, when projects are used by multiple people across multiple computers, it's best to have the specific dependencies and versions specified in the project itself so that everyone using that project is using the exact same version of each dependency.

For recreational projects it's not as big of a deal. It's just harder to do a recreation of your environment.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
The article shows some advantages compared to plain virtual environments:

In principle, you can ‘activate’ this new virtual environment like any typical virtual environment that you may have seen in other tools, but the most ‘uv-onic’ way to use uv is simply to prepend any command with uv run. This command automatically picks up the correct virtual environment for you and runs your command with it. For instance, to run a script — instead of

   source .venv/bin/activate
   python myscript.py
you can just do

   uv run myscript.py
collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> Has the ecosystem fully moved on to uv, now?

It's moving pretty quick.

> Do they have good influence on what python's main ecosystem is moving to?

Yes, they're an early adaptor/implementer of the recent pyproject.toml standards.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> All these comments look like advertisement. "uv is better than python!!", "8/10 programmers recommend uv", "I was a terrible programmer before but uv changed my life!!", "uv is fast!!!"

Have you tried uv?

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> There’s pip, virtualenv, pipx, uv, probably half a dozen others I’m missing...

> Reminds me of that competing standards xkcd.

Yes, for years I've sat on the sidelines avoiding the fragmented Poetry, ppyenv, pipenv, pipx, pip-tools/pip-compile, rye, etc, but uv does now finally seem to be the all-in-one solution that seems to be succeeding where other tools have failed.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
It's fast enough that sometimes dependencies can be checked and resolved and installed at program runtime rather than it needing to be a separate step.

You can go from no virtual environment, and just "uv run myfile.py" and it does everything that's needed, nearly instantly.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> What does uv do in order to resolve dependencies much faster?

- Representing version numbers as single integer for fast comparison.

- Being implemented in rust rather than Python (compared to Poetry)

- Parallel downloads

- Caching individual files rather than zipped wheel, so installation is just hard-linking files, zero copy (on unix at least). Also makes it very storage efficient.

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
uv can be used to speed up building containers.
collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
> 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.

In my experience it generally does all of those well. Are you running into issues with the uv replacements?

> 2. You end up needing to use `uv pip` so it's not even a full replacement for pip.

What do end up needing to use `uv pip` for?

collinmanderson··on Uv is the best thing to happen to the Python ecosystem in a decade
uv is unbelievably fast.
collinmanderson··on Synadia and TigerBeetle Commit $512k USD to the Zig Software Foundation
Would it make sense to merge the points/upvotes too?
collinmanderson··on Django 6.0 beta 1 released
Yes, that's pretty typical. I think there's a general assumption if you're using older python you'll probably stick to Django LTS 5.2 from this April which still supports Python 3.10.

They only drop python versions right after LTS (which is part of why they increase the major version at that point). https://docs.djangoproject.com/en/dev/faq/install/#what-pyth...

Also Django LTS 5.2 is supported a year longer than Ubuntu 22.04. (April 2028 vs April 2027)

collinmanderson··on Replacing a $3000/mo Heroku bill with a $55/mo server
Yes. For these reasons I now have a policy that if you want me maintaining your website / web app, then I manage the hosting. I use something I'm familiar with that I know works.
collinmanderson··on Replacing a $3000/mo Heroku bill with a $55/mo server
I forgot to mention what the parent comment said, yes, need to put something like this in /etc/fstab:

/swapfile swap swap sw 0 0

or via ansible:

    mount:
      src: "/swapfile"
      name: "swap"
      fstype: "swap"
      opts: "sw"
      passno: "0"
      dump: "0"
      state: present
collinmanderson··on Replacing a $3000/mo Heroku bill with a $55/mo server
Yes. I think might also need to chmod 600 /swapfile. I do this on all my VPS, especially helps for small VPS with only 1GB ram:

   fallocate -l 1G /swapfile
   chmod 600 /swapfile
   mkswap /swapfile
   swapon /swapfile
Works really well with no problems that I've seen. Really helps give a bit more of a buffer before applications get killed. Like others have said, with SSD the performance hit isn't too bad.
collinmanderson··on Today is when the Amazon brain drain sent AWS down the spout
> COE

I guessed this was an internal Amazon thing so I searched “Amazon COE”

Correction of Error

https://wa.aws.amazon.com/wellarchitected/2020-07-02T19-33-2...

> SDM

Software Developer Manager (from searching Amazon SDM)

https://amazon.jobs/content/en/how-we-hire/sdm-interview-pre...

collinmanderson··on Replacement.ai
It seems like the _quality_ of the jobs (or median job) may have gone down, but the _quantity_ of jobs relative to population has remained roughly steady, right?
collinmanderson··on Replacement.ai
> isn't "we made a machine to do something that people used to do" basically the entire history of of technology?

I know, right? Machines have been gradually replacing humans for centuries. Will we actually get to the point where there are not enough jobs left? It doesn't seem like we're currently anywhere close to the point of not having any jobs available.

Has anyone thought about how the Federal Reserve plays a role with this? Automation puts downward pressure on inflation, because it doesn't cost as much to make stuff. The Federal Reserve will heavily incentivize job creation if inflation is low enough and there aren't enough jobs available, right?

collinmanderson··on Shai-Hulud malware attack: Tinycolor and over 40 NPM packages compromised
> Perhaps we need a common community effort to create a “distro” of curated and safe dependencies one can install safely, by analyzing the most popular packages and checking what’s common and small enough to be worth being included/forked.

Debian is a common community effort to create a “distro” of curated and safe dependencies one can install safely.

If you want stable, tested versions of software, only getting new versions every few years:

https://packages.debian.org/stable/javascript/

If you want the newer versions of software, less tested, getting new versions continuously:

https://packages.debian.org/unstable/javascript/

collinmanderson··on Shai-Hulud malware attack: Tinycolor and over 40 NPM packages compromised
Why was this comment downvoted? Please explain why you disagree.
collinmanderson··on Shai-Hulud malware attack: Tinycolor and over 40 NPM packages compromised
> sort of a "delayed" mode to updating my own dependencies. The idea is that when I want to update my dependencies, instead of updating to the absolute latest version available of everything, it updates to versions that were released no more than some configurable amount of time ago.

For Python's uv, you can do something like:

> uv lock --exclude-newer $(date --iso -d "2 days ago")

collinmanderson··on A German ISP changed their DNS to block my website
It would ask a root nameserver for an ip address for the .com nameserver, and then ask the .com nameserver for the ip address of the example.com nameserver, then ask the example.com nameserver for further records (and may continue to recurse).

https://en.m.wikipedia.org/wiki/Root_name_server

collinmanderson··on GitHub is no longer independent at Microsoft after CEO resignation
They probably see Cursor as a threat and are trying hard to keep up and avoid losing market share.
collinmanderson··on GPT-5
> Will wait for vibe check from simonw

https://openai.com/gpt-5/?video=1108156668

2:40 "I do like how the pelican's feet are on the pedals." "That's a rare detail that most of the other models I've tried this on have missed."

4:12 "The bicycle was flawless."

5:30 Re generating documentation: "It nailed it. It gave me the exact information I needed. It gave me full architectural overview. It was clearly very good at consuming a quarter million tokens of rust." "My trust issues are beginning to fall away"

Edit: ohh he has blog post now: https://news.ycombinator.com/item?id=44828264

collinmanderson··on Our $100M Series B
Does Oxide require 3-phase power? Do datacenters typically provide 3-phase power?
collinmanderson··on Copyparty – Turn almost any device into a file server
> It already has no deps

Yes when I heard it was python I immediately checked the dependencies expecting a ginormous list and found basically nothing. Incredibly impressive, just a few "stolen" libs here: https://github.com/9001/copyparty/tree/hovudstraum/copyparty...

Worth scrolling through util.py to see lots of hand-implemented code: MultipartParser, read_header(), read_socket_chunked(), html_escape(), atomic_move(), killtree ("still racy but i tried"), termsize(), etc

https://github.com/9001/copyparty/blob/hovudstraum/copyparty...

6k loc for http server/client handling transferring files, rss feed, etc. See `def run(self)` for main request parsing.

https://github.com/9001/copyparty/blob/hovudstraum/copyparty...

collinmanderson··on uv: An extremely fast Python package and project manager, written in Rust
src layout _should_ work. The pyproject.toml needs to live next to src, not inside of it. You might need to `uv run python` in order to pick up the right PYTHONPATH?

https://docs.astral.sh/uv/concepts/projects/init/#packaged-a...

    uv init --package example-pkg
    cd example-pkg
    uv run python
    >>> from example_pkg import main
← PreviousPage 4 of 32Next →