From d794b8e0a20cb62707d641052a92175d17a1832e Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Fri, 27 Jan 2017 13:15:31 -0700 Subject: [PATCH] perform proper_case as best effort approach --- HISTORY.txt | 1 + pipenv/cli.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index eb30df81..a2106db9 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,6 +1,7 @@ 3.2.5: - Significant speed improvements for pipenv run and pipenv shell. - Shell completion via click-completion. + - Perform package name normalization as best effort attempt. 3.2.4: - $ pipenv uninstall --all - Don't uninstall setuptools, wheel, pip, or six. diff --git a/pipenv/cli.py b/pipenv/cli.py index 0d44781d..b4167e85 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -110,8 +110,14 @@ def ensure_proper_casing(): # Replace each package with proper casing. for dep in p[section].keys(): - # Get new casing for package name. - new_casing = proper_case(dep) + # Attempt to normalize name from PyPI. + # Use provided name if better one can't be found. + try: + # Get new casing for package name. + new_casing = proper_case(dep) + except IOError: + # Unable to normalize package name. + continue if new_casing == dep: continue