Merge pull request #79 from chriskuehl/requirements-sorter-nocase

Sort requirements.txt case-insensitively
This commit is contained in:
Anthony Sottile 2015-08-17 12:55:56 -07:00
commit 616c1ebd18
2 changed files with 3 additions and 2 deletions

View file

@ -19,8 +19,8 @@ class Requirement(object):
return False
else:
return (
self.value.partition(b'==') <
requirement.value.partition(b'==')
self.value.lower().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'\nbar\nfoo\n', 0, b'\nbar\nfoo\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'),
)