Created
July 30, 2018 02:21
-
-
Save tsonglew/538b27262be10825cd9ae923d13740fa to your computer and use it in GitHub Desktop.
remove pipenv packages dependencies `pipenv uninstall `pipenv graph --json |python3 depends.py requests``
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 sys | |
import json | |
package = sys.argv[1] | |
other_dependencies = set() | |
removing_dependencies = set([package]) | |
for i in json.load(sys.stdin): | |
for p in i['dependencies']: | |
key = p['key'] | |
if i['package']['key'] == package: | |
removing_dependencies.add(key) | |
else: | |
other_dependencies.add(key) | |
print(' '.join(removing_dependencies - other_dependencies)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment