bugfixes related to os.path.sep for windows (issue #107)

This commit is contained in:
Hugo Lopes Tavares 2010-08-06 15:05:00 -03:00
parent ac452b1a09
commit 4d9fb4f651
3 changed files with 7 additions and 7 deletions

View File

@ -84,7 +84,7 @@ class InstallRequirement(object):
## FIXME: I think getting the requirement here is a bad idea:
#req = get_requirement_from_url(url)
req = None
elif os.path.isdir(path) and ('/' in name or name.startswith('.')):
elif os.path.isdir(path) and (os.path.sep in name or name.startswith('.')):
if not is_installable_dir(path):
raise InstallationError("Directory %r is not installable. File 'setup.py' not found."
% name)

View File

@ -357,14 +357,14 @@ def test_install_folder_using_dot_slash():
def test_install_folder_using_slash_in_the_end():
"""
Test installing a folder using pip install foldername/
r"""
Test installing a folder using pip install foldername/ or foldername\
"""
env = reset_env()
mkdir('mock')
pkg_path = env.scratch_path/'mock'
write_file('setup.py', mock100_setup_py, pkg_path)
result = run_pip('install', 'mock/')
result = run_pip('install', 'mock' + os.path.sep)
egg_folder = env.site_packages / 'mock-100.1-py%s.egg-info' % pyversion
assert egg_folder in result.files_created, str(result)

View File

@ -10,7 +10,7 @@ def test_git_with_sha1_revisions():
version_pkg_path = _create_test_package(env)
_change_test_package_version(env, version_pkg_path)
sha1 = env.run('git', 'rev-parse', 'HEAD~1', cwd=version_pkg_path).stdout.strip()
run_pip('install', '-e', '%s@%s#egg=version_pkg' % ('git+file://' + version_pkg_path, sha1))
run_pip('install', '-e', '%s@%s#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/')), sha1))
version = env.run('version_pkg')
assert '0.1' in version.stdout, version.stdout
@ -23,7 +23,7 @@ def test_git_with_branch_name_as_revision():
version_pkg_path = _create_test_package(env)
env.run('git', 'checkout', '-b', 'test_branch', expect_stderr=True, cwd=version_pkg_path)
_change_test_package_version(env, version_pkg_path)
run_pip('install', '-e', '%s@test_branch#egg=version_pkg' % ('git+file://' + version_pkg_path))
run_pip('install', '-e', '%s@test_branch#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/'))))
version = env.run('version_pkg')
assert 'some different version' in version.stdout
@ -35,7 +35,7 @@ def test_git_with_tag_name_as_revision():
version_pkg_path = _create_test_package(env)
env.run('git', 'tag', 'test_tag', expect_stderr=True, cwd=version_pkg_path)
_change_test_package_version(env, version_pkg_path)
run_pip('install', '-e', '%s@test_tag#egg=version_pkg' % ('git+file://' + version_pkg_path))
run_pip('install', '-e', '%s@test_tag#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/')))
version = env.run('version_pkg')
assert '0.1' in version.stdout