def test_freeze_mercurial_clone(): """ Test freezing a Mercurial clone. """ reset_env() env = get_env() result = env.run('hg', 'clone', '-r', '7bc186caa7dc', local_repo('hg+http://bitbucket.org/jezdez/django-authority'), 'django-authority') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/'django-authority', expect_stderr=True) result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- -e %s@...#egg=django_authority-... ...""" % local_checkout('hg+http://bitbucket.org/jezdez/django-authority')) _check_output(result, expected) result = run_pip('freeze', '-f', '%s#egg=django_authority' % local_checkout('hg+http://bitbucket.org/jezdez/django-authority'), expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -f %(repo)s#egg=django_authority -- stdout: -------------------- -f %(repo)s#egg=django_authority -e %(repo)s@...#egg=django_authority-dev ...""" % {'repo': local_checkout('hg+http://bitbucket.org/jezdez/django-authority')}) _check_output(result, expected)
def test_freeze_git_clone(): """ Test freezing a Git clone. """ env = reset_env() result = env.run('git', 'clone', local_repo('git+http://github.com/jezdez/django-pagination.git'), 'django-pagination') result = env.run('git', 'checkout', '1df6507872d73ee387eb375428eafbfc253dfcd8', cwd=env.scratch_path/'django-pagination', expect_stderr=True) result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path / 'django-pagination') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- -e %s@...#egg=django_pagination-... ...""" % local_checkout('git+http://github.com/jezdez/django-pagination.git')) _check_output(result, expected) result = run_pip('freeze', '-f', '%s#egg=django_pagination' % local_checkout('git+http://github.com/jezdez/django-pagination.git'), expect_stderr=True) expected = textwrap.dedent("""\ Script result: pip freeze -f %(repo)s#egg=django_pagination -- stdout: -------------------- -f %(repo)s#egg=django_pagination -e %(repo)s@...#egg=django_pagination-dev ...""" % {'repo': local_checkout('git+http://github.com/jezdez/django-pagination.git')}) _check_output(result, expected)
def test_freeze_bazaar_clone(): """ Test freezing a Bazaar clone. """ reset_env() env = get_env() result = env.run('bzr', 'checkout', '-r', '174', local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'), 'django-wikiapp') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/'django-wikiapp') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- -e %s@...#egg=django_wikiapp-... ...""" % local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1')) _check_output(result, expected) result = run_pip('freeze', '-f', '%s/#egg=django-wikiapp' % local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'), expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp -- stdout: -------------------- -f %(repo)s/#egg=django-wikiapp -e %(repo)s@...#egg=django_wikiapp-... ...""" % {'repo': local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1')}) _check_output(result, expected)
def test_freeze_git_clone(): """ Test freezing a Git clone. """ env = reset_env() result = env.run('git', 'clone', local_repo('git+http://github.com/pypa/pip-test-package.git'), 'pip-test-package') result = env.run('git', 'checkout', '7d654e66c8fa7149c165ddeffa5b56bc06619458', cwd=env.scratch_path / 'pip-test-package', expect_stderr=True) result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path / 'pip-test-package') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- ...-e %s@...#egg=pip_test_package-... ...""" % local_checkout('git+http://github.com/pypa/pip-test-package.git')) _check_output(result, expected) result = run_pip('freeze', '-f', '%s#egg=pip_test_package' % local_checkout('git+http://github.com/pypa/pip-test-package.git'), expect_stderr=True) expected = textwrap.dedent("""\ Script result: pip freeze -f %(repo)s#egg=pip_test_package -- stdout: -------------------- -f %(repo)s#egg=pip_test_package... -e %(repo)s@...#egg=pip_test_package-dev ...""" % {'repo': local_checkout('git+http://github.com/pypa/pip-test-package.git')}) _check_output(result, expected)
def _test_uninstall_editable_with_source_outside_venv(tmpdir): env = reset_env() result = env.run('git', 'clone', local_repo('git+git://github.com/pypa/virtualenv'), tmpdir) result2 = run_pip('install', '-e', tmpdir) assert (join(env.site_packages, 'virtualenv.egg-link') in result2.files_created), list(result2.files_created.keys()) result3 = run_pip('uninstall', '-y', 'virtualenv', expect_error=True) assert_all_changes(result, result3, [env.venv/'build'])
def _test_uninstall_editable_with_source_outside_venv(tmpdir): env = reset_env() result = env.run("git", "clone", local_repo("git+git://github.com/pypa/virtualenv"), tmpdir) result2 = run_pip("install", "-e", tmpdir) assert join(env.site_packages, "virtualenv.egg-link") in result2.files_created, list(result2.files_created.keys()) result3 = run_pip("uninstall", "-y", "virtualenv", expect_error=True) assert_all_changes(result, result3, [env.venv / "build"])
def test_freeze_bazaar_clone(): """ Test freezing a Bazaar clone. """ checkout_path = local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1') #bzr internally stores windows drives as uppercase; we'll match that. checkout_pathC = checkout_path.replace('c:', 'C:') reset_env() env = get_env() result = env.run('bzr', 'checkout', '-r', '174', local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'), 'django-wikiapp') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/'django-wikiapp') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- ...-e %s@...#egg=django_wikiapp-... ...""" % checkout_pathC) _check_output(result, expected) result = run_pip('freeze', '-f', '%s/#egg=django-wikiapp' % checkout_path, expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp -- stdout: -------------------- -f %(repo)s/#egg=django-wikiapp ...-e %(repoC)s@...#egg=django_wikiapp-... ...""" % {'repoC': checkout_pathC, 'repo': checkout_path}) _check_output(result, expected)
def test_freeze_mercurial_clone(): """ Test freezing a Mercurial clone. """ reset_env() env = get_env() result = env.run('hg', 'clone', '-r', '7bc186caa7dc', local_repo('hg+http://bitbucket.org/jezdez/django-authority'), 'django-authority') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/'django-authority', expect_stderr=True) result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- ...-e %s@...#egg=django_authority-... ...""" % local_checkout('hg+http://bitbucket.org/jezdez/django-authority')) _check_output(result, expected) result = run_pip('freeze', '-f', '%s#egg=django_authority' % local_checkout('hg+http://bitbucket.org/jezdez/django-authority'), expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -f %(repo)s#egg=django_authority -- stdout: -------------------- -f %(repo)s#egg=django_authority ...-e %(repo)s@...#egg=django_authority-dev ...""" % {'repo': local_checkout('hg+http://bitbucket.org/jezdez/django-authority')}) _check_output(result, expected)
def _test_uninstall_editable_with_source_outside_venv(tmpdir): env = reset_env() result = env.run('git', 'clone', local_repo('git+git://github.com/pypa/virtualenv'), tmpdir) result2 = run_pip('install', '-e', tmpdir) assert (join(env.site_packages, 'virtualenv.egg-link') in result2.files_created), list(result2.files_created.keys()) result3 = run_pip('uninstall', '-y', 'virtualenv', expect_error=True) assert_all_changes(result, result3, [env.venv / 'build'])
def test_freeze_svn(): """Now lets try it with an svn checkout""" env = reset_env() result = env.run('svn', 'co', '-r10', local_repo('svn+http://svn.colorstudy.com/INITools/trunk'), 'initools-trunk') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/ 'initools-trunk') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- -e %s@10#egg=INITools-0.3.1dev_r10-py...-dev_r10 ...""" % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')) _check_output(result, expected)
def test_freeze_git_clone(): """ Test freezing a Git clone. """ env = reset_env() result = env.run( 'git', 'clone', local_repo('git+http://github.com/jezdez/django-pagination.git'), 'django-pagination') result = env.run('git', 'checkout', '1df6507872d73ee387eb375428eafbfc253dfcd8', cwd=env.scratch_path / 'django-pagination', expect_stderr=True) result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path / 'django-pagination') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent( """\ Script result: ...pip freeze -- stdout: -------------------- -e %s@...#egg=django_pagination-... ...""" % local_checkout('git+http://github.com/jezdez/django-pagination.git')) _check_output(result, expected) result = run_pip( 'freeze', '-f', '%s#egg=django_pagination' % local_checkout('git+http://github.com/jezdez/django-pagination.git'), expect_stderr=True) expected = textwrap.dedent( """\ Script result: pip freeze -f %(repo)s#egg=django_pagination -- stdout: -------------------- -f %(repo)s#egg=django_pagination -e %(repo)s@...#egg=django_pagination-dev ...""" % { 'repo': local_checkout( 'git+http://github.com/jezdez/django-pagination.git') }) _check_output(result, expected)
def test_freeze_bazaar_clone(): """ Test freezing a Bazaar clone. """ reset_env() env = get_env() result = env.run( 'bzr', 'checkout', '-r', '174', local_repo( 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1' ), 'django-wikiapp') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path / 'django-wikiapp') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- ...-e %s@...#egg=django_wikiapp-... ...""" % local_checkout( 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1' )) _check_output(result, expected) result = run_pip( 'freeze', '-f', '%s/#egg=django-wikiapp' % local_checkout( 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1' ), expect_stderr=True) expected = textwrap.dedent( """\ Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp -- stdout: -------------------- -f %(repo)s/#egg=django-wikiapp ...-e %(repo)s@...#egg=django_wikiapp-... ...""" % { 'repo': local_checkout( 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1' ) }) _check_output(result, expected)
def test_freeze_svn(): """Now lets try it with an svn checkout""" env = reset_env() result = env.run( 'svn', 'co', '-r10', local_repo('svn+http://svn.colorstudy.com/INITools/trunk'), 'initools-trunk') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path / 'initools-trunk') result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent( """\ Script result: ...pip freeze -- stdout: -------------------- -e %s@10#egg=INITools-0.3.1dev_r10-py...-dev_r10 ...""" % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')) _check_output(result, expected)
def test_freeze_svn(): """Test freezing a svn checkout""" checkout_path = local_checkout('svn+http://svn.colorstudy.com/INITools/trunk') #svn internally stores windows drives as uppercase; we'll match that. checkout_path = checkout_path.replace('c:', 'C:') env = reset_env() result = env.run('svn', 'co', '-r10', local_repo('svn+http://svn.colorstudy.com/INITools/trunk'), 'initools-trunk') result = env.run('python', 'setup.py', 'develop', cwd=env.scratch_path/ 'initools-trunk', expect_stderr=True) result = run_pip('freeze', expect_stderr=True) expected = textwrap.dedent("""\ Script result: ...pip freeze -- stdout: -------------------- -e %s@10#egg=INITools-0.3.1dev...-dev_r10 ...""" % checkout_path) _check_output(result, expected)