pypi: Why don't all the packages use wheel?
Asked Answered
B

1

6

This python wheel website says, only 300 of the top 360 packages use wheel. I further analysed the Python ecosystem and found that about 2961 packages out of top 5000 use wheel, and others don't.

My questions are:

  1. If they don't use wheel, do they use egg?
  2. Why don't they use wheel? Is that just the laziness of authors or something else, which stop them from using wheel.
  3. I also found from this post that wheel stops install time scripts (correct me if I'm wrong here). So, isn't it the case that because of some wheel functionalities, those packages can't use wheel (because they might need some functionalities of setup.py file, during the installation, e.g. install time scripts).
Bewilderment answered 23/5, 2019 at 19:2 Comment(2)
Down voter please explain?Bewilderment
thanks @halfer I'll keep that in mindBewilderment
I
4

If they don't use wheel, do they use egg?

They probably don't. Wheels are built distributions, the alternative is to provide a source distribution, so this is likely what these packages are publishing instead (source distributions have filenames that end in .zip or .tar.gz.

Why don't they use wheel? Is that just the laziness of authors or something else, which stop them from using wheel.

Unless the project can be built with pure-Python wheels, building wheels for a certain platform requires access to a similar build environment. It's possible that they either don't have a given build environment, or don't have enough users to justify the extra work. It's also possible that their package is trivial enough that it doesn't make much difference to install from source vs. from a built distribution.

I also found from this post that wheel stops install time scripts (correct me if I'm wrong here).

This is correct: wheels are built for a given platform, and thus don't do anything at install-time other than put the package in the path.

So, isn't it the case that because of some wheel functionalities, those packages can't use wheel (because they might need some functionalities of setup.py file, during the installation, e.g. install time scripts).

Not really, any package that can be installed can produce a wheel. There is the possibility that a given package is doing more than just installing at install-time (e.g., perhaps it is also downloading some large files or something from an external source) but patterns like this are generally discouraged.

Intuition answered 23/5, 2019 at 19:12 Comment(3)
Thanks so much @DustinBewilderment
If a "package is trivial enough that it doesn't make much difference", e.g. *.py, README, setup stuff, no platform dependencies), will Pypi / pip be ok with a wheel only -- python setup.py bdist_wheel, no sdist ?Sinclare
Yes, it's fine as long as it's a pure-python wheel, but it's considered good practice to publish a source distribution as well. There really isn't any reason not to publish a source distribution.Intuition

© 2022 - 2024 — McMap. All rights reserved.