3 ms·
It has never been clear to me what the term "wheels" means in software releases. seems like something along the lines of "thing that works" – does it mean anyth
by semiinfinitely 1y ago
It has never been clear to me what the term "wheels" means in software releases. seems like something along the lines of "thing that works" – does it mean anything more specific than that?
- borntyping 1y agoIt doesn't mean anything useful in this context. It's a leftover from when PyPI was called "the cheeseshop", which in turn was a reference to a Monty Python sketch.
- morkalork 1y agoCheese wheels?! TIL. Also, for once it isn't a car analogy.
- woodruffw 1y agoIt's a Python packaging specific term. A "wheel" is a built distribution, which in the most basic sense just means that it can be unarchived directly into a Python import prefix instead of needing a build step (historically `setup.py`) to prepare it for installation. In practice, many built distributions contain binary artifacts (e.g. builds of CPython extensions). This differentiates them from source distributions, where you'd build the extension from source on your local machine.
- zahlman 1y ago> In practice, many built distributions contain binary artifacts (e.g. builds of CPython extensions). This differentiates them from source distributions This seems like a good opportunity to mention that that the wheel isn't required to contain any non-Python content, and indeed it's strongly preferred to provide one even (I would say "especially") when there is no meaningful "build step" (https://pradyunsg.me/blog/2022/12/31/wheels-are-faster-pure-python/ https://pradyunsg.me/blog/2022/12/31/wheels-are-faster-pure-...). There are of course abandoned legacy projects around from before the option was available, that may never get fixed. But developers of new code in pure Python should ensure they understand the system. (I would strongly prefer if we could have a single type of package artifact with an optional post-install hook for building any needed non-Python content. Alas....)
- woodruffw 1y agoYeah, I was simplifying. Wheels are in many ways a strictly better alternative to source distributions even in the “pure” case!
- zahlman 1y ago"Wheel" is the Python-specific terminology for a pre-built package (all non-Python code has been compiled ahead of time, and the necessary object files put in the right places in the package's folder hierarchy), such that installers can simply copy the files (and do a little bit of book-keeping, and possibly pre-compile Python source code to bytecode although the interpreter will do that on demand anyway). The format is originally documented in https://peps.python.org/pep-0427/ https://peps.python.org/pep-0427/ . This contrasts with "sdist", short for "source distribution", which potentially contains code in other languages which must be compiled on the end user's machine (which possibly involves downloading a corresponding build system and setting up a temporary build environment at install time). Wheel and sdist distributions are successors to a legacy "egg" format. The PEP doesn't explain, but it's commonly held that the name "wheel" is a reference to wheels of cheese, based on PyPI's prior existence as "the cheese shop" (itself a reference to https://www.youtube.com/watch?v=Hz1JWzyvv8A https://www.youtube.com/watch?v=Hz1JWzyvv8A). There might be some ancient discussion on the (now archived and inactive) mailing list to support this.