Skip to content

Instantly share code, notes, and snippets.

@adamchainz
Created October 13, 2016 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamchainz/8933360a6c831663675f623e3f05cd36 to your computer and use it in GitHub Desktop.
Save adamchainz/8933360a6c831663675f623e3f05cd36 to your computer and use it in GitHub Desktop.
import subprocess
import requests
def print_all_non_wheels():
output = subprocess.check_output(['pip', 'freeze']).decode()
lines = [l.strip() for l in output.split('\n') if l.strip()]
for line in lines:
package, *_ = line.split('==')
data = requests.get('https://pypi.python.org/pypi/{}/json'.format(package))
if not data.status_code == 200:
print('not on PyPI:', package)
continue
has_wheel = any(url['packagetype'] == 'bdist_wheel' for url in data.json()['urls'])
if not has_wheel:
print('not a wheel:', package)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment