diff --git a/pipreqs/mapping b/pipreqs/mapping index 3608616..4c72ea8 100644 --- a/pipreqs/mapping +++ b/pipreqs/mapping @@ -9,7 +9,8 @@ BeautifulSoupTests:BeautifulSoup BioSQL:biopython BuildbotStatusShields:BuildbotEightStatusShields ComputedAttribute:ExtensionClass -Crypto:pycrypto +Crypto:pycryptodome +Cryptodome:pycryptodomex FSM:pexpect FiftyOneDegrees:51degrees_mobile_detector_v3_wrapper GeoBaseMain:GeoBasesDev @@ -800,7 +801,7 @@ nester:abofly nester:bssm_pythonSig novaclient:python_novaclient oauth2_provider:alauda_django_oauth -oauth2client:google_api_python_client +oauth2client:oauth2client odf:odfpy ometa:Parsley openid:python_openid @@ -913,6 +914,7 @@ polymorphic:django_polymorphic portalocker:ConcurrentLogHandler postmark:python_postmark powerprompt:bash_powerprompt +prefetch:django-prefetch printList:AndrewList progressbar:progressbar2 progressbar:progressbar33 diff --git a/pipreqs/pipreqs.py b/pipreqs/pipreqs.py index 371a4fb..b5f664b 100755 --- a/pipreqs/pipreqs.py +++ b/pipreqs/pipreqs.py @@ -290,7 +290,7 @@ def get_pkg_names(pkgs): # simply use the package name. result.add(data.get(pkg, pkg)) # Return a sorted list for backward compatibility. - return sorted(result) + return sorted(result, key=lambda s: s.lower()) def get_name_without_alias(name): diff --git a/tests/test_pipreqs.py b/tests/test_pipreqs.py index cefd57f..7f2daaf 100755 --- a/tests/test_pipreqs.py +++ b/tests/test_pipreqs.py @@ -69,6 +69,12 @@ class TestPipreqs(unittest.TestCase): item['name'].lower() in self.modules, "Import item appears to be missing " + item['name']) + def test_get_pkg_names(self): + pkgs = ['jury', 'Japan', 'camel', 'Caroline'] + actual_output = pipreqs.get_pkg_names(pkgs) + expected_output = ['camel', 'Caroline', 'Japan', 'jury'] + self.assertEqual(actual_output, expected_output) + def test_get_use_local_only(self): """ Test without checking PyPI, check to see if names of local imports matches what we expect