Permalink
Browse files

upper case url reqs should be recognized as same as other lower case …

…forms
  • Loading branch information...
1 parent 843ffb3 commit dc5e825d4e915ff39a2368f9fb4d2c15ca358aa9 @qwcode qwcode committed Nov 14, 2012
View
@@ -1094,8 +1094,8 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
subreq = InstallRequirement(req, req_to_install)
reqs.append(subreq)
self.add_requirement(subreq)
- if req_to_install.name not in self.requirements:
- self.requirements[req_to_install.name] = req_to_install
+ if not self.has_requirement(req_to_install.name):
+ self.add_requirement(req_to_install)
if self.is_download or req_to_install._temp_build_dir is not None:
self.reqs_to_cleanup.append(req_to_install)
else:
@@ -62,6 +62,11 @@ simple-[123].0.tar.gz
---------------------
contains "simple" package; good for basic testing and version logic.
+Upper-[12].0.tar.gz and requiresuppper-1.0.tar.gz
+--------------------------------------------------
+'requiresupper' requires 'upper'
+used for testing case mismatch case for url requirements
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -184,3 +184,26 @@ def test_install_local_editable_with_extras():
assert env.site_packages/'easy-install.pth' in res.files_updated
assert env.site_packages/'LocalExtras.egg-link' in res.files_created
assert env.site_packages/'simple' in res.files_created
+
+
+def test_url_req_case_mismatch():
+ """
+ tar ball url requirements (with no egg fragment), that happen to have upper case project names,
+ should be considered equal to later requirements that reference the project name using lower case.
+
+ tests/packages contains Upper-1.0.tar.gz and Upper-2.0.tar.gz
+ 'requiresupper' has install_requires = ['upper']
+ """
+ env = reset_env()
+ find_links = 'file://' + os.path.join(here, 'packages')
+ Upper = os.path.join(find_links, 'Upper-1.0.tar.gz')
+ result = run_pip('install', '--no-index', '-f', find_links, Upper, 'requiresupper')
+
+ #only Upper-1.0.tar.gz should get installed.
+ egg_folder = env.site_packages / 'Upper-1.0-py%s.egg-info' % pyversion
+ assert egg_folder in result.files_created, str(result)
+ egg_folder = env.site_packages / 'Upper-2.0-py%s.egg-info' % pyversion
+ assert egg_folder not in result.files_created, str(result)
+
+
+

0 comments on commit dc5e825

Please sign in to comment.