Created
October 13, 2016 13:41
-
-
Save adamchainz/8933360a6c831663675f623e3f05cd36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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