logoalt Hacker News

BiteCode_dev12/09/20241 replyview on HN

Bootstrapping python incorrectly is the main source of packaging problem.

There is a lot to leak. For exemple, if you install a non wheel compiled extension, you'll need the headers, but some python distro don't provide it.

Then of course, on windows, is your python registered with the py launcher? How does it interact with existing anaconda installations ? On linux on existing system installation ? Is the shim (or path update for mise) affecting /bin/env ? How that works with .pyw association ?

The. what does it implies on the venv creation and activation ? And on using -m ? And .pth files ? user-sites ?

All those questions are linked to bootstrapping.

What happens then is pip install fail or import break, but the user have no idea it's related to his bad python setup because most people don't know how it works.

And now bootstrapping has broken packaging.

This is where most "python packaging sucks" things are born: from unkowingly botching the bootstrapping.

And the vast majority of tools to do it suck. E.g: Shims are all kind of broken (pyenv and rye come to mind).

To suceed, mise would have to know all that, pick the right tool, make a perfect abstraction, create fantastic error reporting, and test all those cases on ci on all platforms.

It's possible, but I know only one project that does this almost correctly. And even this one has a long way to go.

Saying "there is literally nothing to leak" is actually perfectly making my point most people don't know the topic deeply enough to know what they get into.

Then of courses there are all the modes of failure. This article has a good bit about that:

https://www.bitecode.dev/p/why-not-tell-people-to-simply-use

It's cover more than mise's scope, but the idea is there.


Replies

HelloNurse12/09/2024

I'm trying to use rye on Windows, but it doesn't want to use the normal installed Python version, only the versions it downloads itself, and it cannot update them easily because it pins an old one to run itself.

So far I've wasted more time than I saved.