pypi: how to check if the package is using wheel
Asked Answered
I

3

7

I want to write a script which goes through all the packages on pypi repository, to check whether they are using wheel or egg.

I know that by the new standard, it is mandatory for all the packages to use wheel and not egg. I found this information on this website. They also have the list of packages which do and don't use wheel. But, they list only top few packages. But, I would like to check this for all the packages on pypi. I know that on pypi website they show if the types of files available to download e.g. this shows that there is no wheel file type is available to download, on the contrary this shows that the wheel format is available to download. Does something like this help me in achieving my goal?

I certainly don't expect someone to write a script for me, but I would like a hint on how to figure if the package is using wheel.

Indignation answered 15/5, 2019 at 20:18 Comment(2)
Are you re-implementing Python Wheels?Twiddle
that project checks few hundred popular packages (300/360) if they have uploaded wheel format files. I want check whole pypi repository in the similar way.Indignation
A
6

PyPI has a JSON API which will give you all the releases for a given project, and all the files for a given release: https://warehouse.readthedocs.io/api-reference/json/

Absent answered 15/5, 2019 at 20:38 Comment(0)
M
2

PIP, by default, uses the Simple PyPi Repository.

If you open the link, you can see that it has a link for every single available package.

If you open a package link, you can see different packages, versions, and download options available.

Obviously, you'll have to test for edge cases, but I should think checking if the latest version has a .whl extension should be a good starting place.

Matabele answered 15/5, 2019 at 20:30 Comment(3)
Thanks @Triggernometry, this seems like a better wayIndignation
sorry, but I have to select @dustin Ingram's answer as it seems like way more easier.Indignation
@Ruturaj No worries! But just so you know, it's recommended you wait for an hour or so before you accept an answer, for just this reason.Matabele
T
1

You can use pip download to download the required library, and then check if it is a wheel file or something else. But, that way, you only check the libraries available for your own distribution/OS and Python version. There may be variants…

Twiddle answered 15/5, 2019 at 20:29 Comment(1)
thanks @laurent that's a good idea but rather time consuming and as you said depends on my own dist/os. But thanks anyways.Indignation

© 2022 - 2024 — McMap. All rights reserved.