top | item 40910039

(no title)

oblvious-earth | 1 year ago

> The people who say "just use pip and venv" don't understand the issue.

The people saying that say that because it works for them and it solved their problems.

> setuptools is somewhat deprecated but not really

setuptools remains the default and most popular backend (the thing that builds your package). What was deprecated was calling it directly, instead you use pip or build or any other frontend.

Why? One reason is because it exposed lots of non-standard eccentricities that users would then start to rely on, breaking the effort of standardisation.

> Or perhaps pyproject.toml? If the latter, flit, poetry and the 100 other frontends all have a different syntax.

They all use toml syntax, they all use the same build dependency standard, poetry does not use PEP 440 configuring version dependencies, but it does read PEP 440 dependencies from wheel metadata fine. I hope one day the version dependency spec can be updated with everything that has been learnt, from both Poetry and the rest of the ecosystem, but Python packaging is a slow moving beast.

> Should you use pip? Well, the latest hotness are the search-unfriendly named modules "build" and "install", which create a completely isolated environment.

pip does this for you though, I'm not sure why most end users need to know "build" or "install" exist.

> Which is the officially supported tool that will stay supported and not ripped out like distutils?

I'm not sure why you think any of these are "the officially supported tool", they are an attempt by various PyPA members to minimally and correctly implement the standards, but PyPA is a loose collection of volunteers.

Whereas, CPython core dev have a pretty clear arms length attitude towards all of packaging. This for me feels like the real contention in the Python packaging world.

> Questions over questions. And all that for creating a simple zip archive of a directory, which for some reason demands gigantic frameworks.

Well the people using pip and venv didn't have any of these questions, they just got on with it because it solved everything for them.

Likely you want your package to figure something out as it’s being built, or have interesting metadata, or include binaries, or something else not on the happy path, and you want your build tool to "just work" even though chances are you’re doing something not that simple or what the tool creator thought. Otherwise, if you really just need a “simple zip archive of a directory” just write out the directory and call python -m zipfile.

There’s nothing wrong with lots of people needing specific use cases, but it does mean all these build tools need to add lots and lots of options to accommodate them all, and before you know it you're complaining of a "gigantic framework" (even though I wouldn't describe either setuptools or hatchling like that).

discuss

order

lwhyajh|1 year ago

> pip does this for you though, I'm not sure why most end users need to know "build" or "install" exist.

Because at least at one point in time "build" was marketed as the future, it even appeared in a setuptools warning message. This developer spends several paragraphs on the issue:

https://gregoryszorc.com/blog/2023/10/30/my-user-experience-...

If it is no longer the future, so be it. Pip seemed to force isolated installs by default for a while and then backed off again.

As for the volunteer question: All OSS package managers are maintained by volunteers and I do not know of any other ecosystem that prompted an xkcd comic about the packaging situation.

mardifoufs|1 year ago

Wait, so build isn't the future standard/"happy path" anymore? I thought setup.py will inevitably be phased out. Do you have any links or discussion that point to that change?