Skip to content

Instantly share code, notes, and snippets.

@pyfisch
Created March 30, 2016 21:04
Show Gist options
  • Select an option

  • Save pyfisch/a535fec885dd4efb2f77b4c4fd6ebd3b to your computer and use it in GitHub Desktop.

Select an option

Save pyfisch/a535fec885dd4efb2f77b4c4fd6ebd3b to your computer and use it in GitHub Desktop.
import json, sys, os
for r, d, f in os.walk('.'):
if r.startswith('./.git') or r == '.':
continue
for filename in f:
with open(os.path.join(r, filename)) as file:
last = file.readlines()[-1]
deps = json.loads(last)['deps']
star_deps = []
for dep in deps:
if dep['req'] == '*':
star_deps.append(dep['name'])
if star_deps:
print(filename, end=' -> ')
print(star_deps[0], end='')
for dep in star_deps[1:]:
print(', ' + dep, end='')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment