Sort requirements.txt case-insensitively

This commit is contained in:
Chris Kuehl 2015-08-17 12:43:13 -07:00
parent c2992bd3a1
commit a1b0104f3d
2 changed files with 3 additions and 2 deletions

View file

@ -19,8 +19,8 @@ class Requirement(object):
return False return False
else: else:
return ( return (
self.value.partition(b'==') < self.value.lower().partition(b'==') <
requirement.value.partition(b'==') requirement.value.lower().partition(b'==')
) )

View file

@ -16,6 +16,7 @@ TESTS = (
(b'\nfoo\nbar\n', 1, b'bar\n\nfoo\n'), (b'\nfoo\nbar\n', 1, b'bar\n\nfoo\n'),
(b'\nbar\nfoo\n', 0, b'\nbar\nfoo\n'), (b'\nbar\nfoo\n', 0, b'\nbar\nfoo\n'),
(b'pyramid==1\npyramid-foo==2\n', 0, b'pyramid==1\npyramid-foo==2\n'), (b'pyramid==1\npyramid-foo==2\n', 0, b'pyramid==1\npyramid-foo==2\n'),
(b'ocflib\nDjango\nPyMySQL\n', 1, b'Django\nocflib\nPyMySQL\n'),
) )