Skip to content

Commit 8c67bcc

Browse files
committed
Remove now useless code
since a23a65c
1 parent b3406f7 commit 8c67bcc

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

pip/index.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from pip.compat import ipaddress
1919
from pip.utils import (
20-
Inf, cached_property, normalize_name, splitext, normalize_path,
20+
Inf, cached_property, splitext, normalize_path,
2121
ARCHIVE_EXTENSIONS, SUPPORTED_EXTENSIONS)
2222
from pip.utils.deprecation import RemovedInPip9Warning
2323
from pip.utils.logging import indent_log
@@ -527,30 +527,6 @@ def find_requirement(self, req, upgrade):
527527

528528
return selected_version
529529

530-
def _find_url_name(self, index_url, url_name):
531-
"""
532-
Finds the true URL name of a package, when the given name isn't quite
533-
correct.
534-
This is usually used to implement case-insensitivity.
535-
"""
536-
if not index_url.url.endswith('/'):
537-
# Vaguely part of the PyPI API... weird but true.
538-
# FIXME: bad to modify this?
539-
index_url.url += '/'
540-
page = self._get_page(index_url)
541-
if page is None:
542-
logger.critical('Cannot fetch index base URL %s', index_url)
543-
return
544-
norm_name = normalize_name(url_name)
545-
for link in page.links:
546-
base = posixpath.basename(link.path.rstrip('/'))
547-
if norm_name == normalize_name(base):
548-
logger.debug(
549-
'Real name of requirement %s is %s', url_name, base,
550-
)
551-
return base
552-
return None
553-
554530
def _get_pages(self, locations, project_name):
555531
"""
556532
Yields (page, page_url) from the given locations, skipping

pip/utils/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from io import StringIO
3232

3333
__all__ = ['rmtree', 'display_path', 'backup_dir',
34-
'ask', 'Inf', 'normalize_name', 'splitext',
34+
'ask', 'Inf', 'splitext',
3535
'format_size', 'is_installable_dir',
3636
'is_svn_page', 'file_contents',
3737
'split_leading_dir', 'has_leading_dir',
@@ -186,13 +186,6 @@ def __repr__(self):
186186
del _Inf
187187

188188

189-
_normalize_re = re.compile(r'[^a-z]', re.I)
190-
191-
192-
def normalize_name(name):
193-
return _normalize_re.sub('-', name.lower())
194-
195-
196189
def format_size(bytes):
197190
if bytes > 1000 * 1000:
198191
return '%.1fMB' % (bytes / 1000.0 / 1000)

0 commit comments

Comments
 (0)