Created
October 30, 2015 08:08
-
-
Save ViktorOgnev/2e78d0989df242baa14e to your computer and use it in GitHub Desktop.
Copmare output of 2 pip freeze commands
This file contains hidden or 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
def compare_deps(freeze1, freeze2): | |
freeze1 = freeze1.splitlines() | |
freeze2 = freeze2.splitlines() | |
print('arg1 contains {} items, arg2 contains {} items'.format(len(freeze1), len(freeze2))) | |
for item1 in freeze1: | |
if '==' not in item1: | |
continue | |
name1, ver1 = item1.split('==') | |
for item2 in freeze2: | |
if '==' not in item2: | |
continue | |
name2, ver2 = item2.split('==') | |
if name1 == name2 and ver1 != ver2: | |
print('Mismatch {} {}'.format(item1, item2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment