当前位置: 首页>>代码示例>>Python>>正文


Python local_repos.local_checkout函数代码示例

本文整理汇总了Python中tests.lib.local_repos.local_checkout函数的典型用法代码示例。如果您正苦于以下问题:Python local_checkout函数的具体用法?Python local_checkout怎么用?Python local_checkout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了local_checkout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_cleanup_after_create_bundle

def test_cleanup_after_create_bundle():
    """
    Test clean up after making a bundle. Make sure (build|src)-bundle/ dirs are removed but not src/.

    """
    env = reset_env()
    # Install an editable to create a src/ dir.
    args = ['install']
    args.extend(['-e',
                 '%s#egg=pip-test-package' %
                    local_checkout('git+http://github.com/pypa/pip-test-package.git')])
    run_pip(*args)
    build = env.venv_path/"build"
    src = env.venv_path/"src"
    assert not exists(build), "build/ dir still exists: %s" % build
    assert exists(src), "expected src/ dir doesn't exist: %s" % src

    # Make the bundle.
    fspkg = 'file://%s/FSPkg' %join(tests_data, 'packages')
    pkg_lines = textwrap.dedent('''\
            -e %s
            -e %s#egg=initools-dev
            pip''' % (fspkg, local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')))
    write_file('bundle-req.txt', pkg_lines)
    run_pip('bundle', '-r', 'bundle-req.txt', 'test.pybundle')
    build_bundle = env.scratch_path/"build-bundle"
    src_bundle = env.scratch_path/"src-bundle"
    assert not exists(build_bundle), "build-bundle/ dir still exists: %s" % build_bundle
    assert not exists(src_bundle), "src-bundle/ dir still exists: %s" % src_bundle
    env.assert_no_temp()

    # Make sure previously created src/ from editable still exists
    assert exists(src), "expected src dir doesn't exist: %s" % src
开发者ID:Basis,项目名称:pip,代码行数:33,代码来源:test_bundle.py

示例2: test_freeze_mercurial_clone

def test_freeze_mercurial_clone(script, tmpdir):
    """
    Test freezing a Mercurial clone.

    """
    result = script.run('hg', 'clone',
                     '-r', 'c9963c111e7c',
                     local_repo('hg+http://bitbucket.org/pypa/pip-test-package', tmpdir.join("cache")),
                     'pip-test-package')
    result = script.run('python', 'setup.py', 'develop',
            cwd=script.scratch_path/'pip-test-package', expect_stderr=True)
    result = script.pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %[email protected]#egg=pip_test_package-...
        ...""" % local_checkout('hg+http://bitbucket.org/pypa/pip-test-package', tmpdir.join("cache")))
    _check_output(result, expected)

    result = script.pip('freeze', '-f',
                     '%s#egg=pip_test_package' % local_checkout('hg+http://bitbucket.org/pypa/pip-test-package', tmpdir.join("cache")),
                     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)[email protected]#egg=pip_test_package-dev
        ...""" % {'repo': local_checkout('hg+http://bitbucket.org/pypa/pip-test-package', tmpdir.join("cache"))})
    _check_output(result, expected)
开发者ID:1stvamp,项目名称:pip,代码行数:29,代码来源:test_freeze.py

示例3: test_cleanup_after_create_bundle

def test_cleanup_after_create_bundle(script, tmpdir, data):
    """
    Test clean up after making a bundle. Make sure (build|src)-bundle/ dirs are removed but not src/.

    """
    # Install an editable to create a src/ dir.
    args = ['install']
    args.extend(['-e',
                 '%s#egg=pip-test-package' %
                    local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache"))])
    script.pip(*args)
    build = script.venv_path/"build"
    src = script.venv_path/"src"
    assert not exists(build), "build/ dir still exists: %s" % build
    assert exists(src), "expected src/ dir doesn't exist: %s" % src

    # Make the bundle.
    fspkg = path_to_url(data.packages/'FSPkg')
    pkg_lines = textwrap.dedent('''\
            -e %s
            -e %s#egg=initools-dev
            pip''' % (fspkg, local_checkout('svn+http://svn.colorstudy.com/INITools/trunk', tmpdir.join("cache"))))
    script.scratch_path.join("bundle-req.txt").write(pkg_lines)
    script.pip('bundle', '-r', 'bundle-req.txt', 'test.pybundle')
    build_bundle = script.scratch_path/"build-bundle"
    src_bundle = script.scratch_path/"src-bundle"
    assert not exists(build_bundle), "build-bundle/ dir still exists: %s" % build_bundle
    assert not exists(src_bundle), "src-bundle/ dir still exists: %s" % src_bundle
    script.assert_no_temp()

    # Make sure previously created src/ from editable still exists
    assert exists(src), "expected src dir doesn't exist: %s" % src
开发者ID:Ivoz,项目名称:pip,代码行数:32,代码来源:test_bundle.py

示例4: test_editable_no_install_followed_by_no_download

def test_editable_no_install_followed_by_no_download(script, tmpdir):
    """
    Test installing an editable in two steps (first with --no-install, then
    with --no-download).
    """
    result = script.pip(
        'install',
        '-e',
        '%s#egg=initools-dev' %
        local_checkout(
            'svn+http://svn.colorstudy.com/INITools/trunk',
            tmpdir.join("cache"),
        ),
        '--no-install',
        expect_error=True,
    )
    result.assert_installed(
        'INITools', without_egg_link=True, with_files=['.svn'],
    )

    result = script.pip(
        'install',
        '-e',
        '%s#egg=initools-dev' %
        local_checkout(
            'svn+http://svn.colorstudy.com/INITools/trunk',
            tmpdir.join("cache"),
        ),
        '--no-download',
        expect_error=True,
    )
    result.assert_installed('INITools', without_files=[curdir, '.svn'])
开发者ID:510908220,项目名称:pip,代码行数:32,代码来源:test_install.py

示例5: test_uninstall_from_reqs_file

def test_uninstall_from_reqs_file(script, tmpdir):
    """
    Test uninstall from a requirements file.

    """
    script.scratch_path.join("test-req.txt").write(textwrap.dedent("""\
        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk', tmpdir.join("cache"))))
    result = script.pip('install', '-r', 'test-req.txt')
    script.scratch_path.join("test-req.txt").write(textwrap.dedent("""\
        # -f, -i, and --extra-index-url should all be ignored by uninstall
        -f http://www.example.com
        -i http://www.example.com
        --extra-index-url http://www.example.com

        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk', tmpdir.join("cache"))))
    result2 = script.pip('uninstall', '-r', 'test-req.txt', '-y')
    assert_all_changes(
        result, result2, [script.venv/'build', script.venv/'src', script.scratch/'test-req.txt',
        script.site_packages/'easy-install.pth'])
开发者ID:1stvamp,项目名称:pip,代码行数:25,代码来源:test_uninstall.py

示例6: test_uninstall_from_reqs_file

def test_uninstall_from_reqs_file():
    """
    Test uninstall from a requirements file.

    """
    env = reset_env()
    write_file('test-req.txt', textwrap.dedent("""\
        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')))
    result = run_pip('install', '-r', 'test-req.txt')
    write_file('test-req.txt', textwrap.dedent("""\
        # -f, -i, and --extra-index-url should all be ignored by uninstall
        -f http://www.example.com
        -i http://www.example.com
        --extra-index-url http://www.example.com

        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')))
    result2 = run_pip('uninstall', '-r', 'test-req.txt', '-y')
    assert_all_changes(
        result, result2, [env.venv/'build', env.venv/'src', env.scratch/'test-req.txt'])
开发者ID:Basis,项目名称:pip,代码行数:25,代码来源:test_uninstall.py

示例7: test_freeze_git_clone

def test_freeze_git_clone(script, tmpdir):
    """
    Test freezing a Git clone.

    """
    result = script.run('git', 'clone', local_repo('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache")), 'pip-test-package', expect_stderr=True)
    result = script.run('git', 'checkout', '7d654e66c8fa7149c165ddeffa5b56bc06619458',
            cwd=script.scratch_path / 'pip-test-package', expect_stderr=True)
    result = script.run('python', 'setup.py', 'develop',
            cwd=script.scratch_path / 'pip-test-package')
    result = script.pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %[email protected]#egg=pip_test_package-...
        ...""" % local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache")))
    _check_output(result, expected)

    result = script.pip('freeze', '-f',
                     '%s#egg=pip_test_package' % local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache")),
                     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)[email protected]#egg=pip_test_package-0.1.1
        ...""" % {'repo': local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache"))})
    _check_output(result, expected)
开发者ID:1stvamp,项目名称:pip,代码行数:28,代码来源:test_freeze.py

示例8: test_git_with_tag_name_and_update

def test_git_with_tag_name_and_update(script, tmpdir):
    """
    Test cloning a git repository and updating to a different version.
    """
    result = script.pip('install', '-e', '%s#egg=pip-test-package' %
                     local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache")),
                     expect_error=True)
    result.assert_installed('pip-test-package', with_files=['.git'])
    result = script.pip('install', '--global-option=--version', '-e',
                     '%[email protected]#egg=pip-test-package' %
                     local_checkout('git+http://github.com/pypa/pip-test-package.git', tmpdir.join("cache")),
                     expect_error=True)
    assert '0.1.2' in result.stdout
开发者ID:1stvamp,项目名称:pip,代码行数:13,代码来源:test_install_vcs.py

示例9: test_freeze_bazaar_clone

def test_freeze_bazaar_clone(script, tmpdir):
    """
    Test freezing a Bazaar clone.

    """

    checkout_path = local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1', tmpdir.join("cache"))
    #bzr internally stores windows drives as uppercase; we'll match that.
    checkout_pathC = checkout_path.replace('c:', 'C:')

    result = script.run('bzr', 'checkout', '-r', '174',
                     local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1', tmpdir.join("cache")),
                     'django-wikiapp')
    result = script.run('python', 'setup.py', 'develop',
            cwd=script.scratch_path/'django-wikiapp')
    result = script.pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %[email protected]#egg=django_wikiapp-...
        ...""" % checkout_pathC)
    _check_output(result, expected)

    result = script.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)[email protected]#egg=django_wikiapp-...
        ...""" % {'repoC': checkout_pathC, 'repo': checkout_path})
    _check_output(result, expected)
开发者ID:1stvamp,项目名称:pip,代码行数:33,代码来源:test_freeze.py

示例10: test_git_with_editable_where_egg_contains_dev_string

def test_git_with_editable_where_egg_contains_dev_string(script, tmpdir):
    """
    Test cloning a git repository from an editable url which contains "dev" string
    """
    result = script.pip('install', '-e', '%s#egg=django-devserver' %
                     local_checkout('git+git://github.com/dcramer/django-devserver.git', tmpdir.join("cache")))
    result.assert_installed('django-devserver', with_files=['.git'])
开发者ID:1stvamp,项目名称:pip,代码行数:7,代码来源:test_install_vcs.py

示例11: test_upgrade_vcs_req_with_no_dists_found

def test_upgrade_vcs_req_with_no_dists_found(script, tmpdir):
    """It can upgrade a VCS requirement that has no distributions otherwise."""
    req = "%s#egg=pip-test-package" % local_checkout(
        "git+http://github.com/pypa/pip-test-package.git", tmpdir.join("cache"))
    script.pip("install", req)
    result = script.pip("install", "-U", req)
    assert not result.returncode
开发者ID:1stvamp,项目名称:pip,代码行数:7,代码来源:test_install_upgrade.py

示例12: test_upgrade_vcs_req_with_no_dists_found

def test_upgrade_vcs_req_with_no_dists_found():
    """It can upgrade a VCS requirement that has no distributions otherwise."""
    reset_env()
    req = "%s#egg=pip-test-package" % local_checkout("git+http://github.com/pypa/pip-test-package.git")
    run_pip("install", req)
    result = run_pip("install", "-U", req)
    assert not result.returncode
开发者ID:Basis,项目名称:pip,代码行数:7,代码来源:test_install_upgrade.py

示例13: test_freeze_svn

def test_freeze_svn(script, tmpdir):
    """Test freezing a svn checkout"""

    checkout_path = local_checkout(
        'svn+http://svn.colorstudy.com/INITools/trunk',
        tmpdir.join("cache"),
    )
    # svn internally stores windows drives as uppercase; we'll match that.
    checkout_path = checkout_path.replace('c:', 'C:')

    # Checkout
    script.run(
        'svn', 'co', '-r10',
        local_repo(
            'svn+http://svn.colorstudy.com/INITools/trunk',
            tmpdir.join("cache"),
        ),
        'initools-trunk',
    )
    # Install with develop
    script.run(
        'python', 'setup.py', 'develop',
        cwd=script.scratch_path / 'initools-trunk',
        expect_stderr=True,
    )
    result = script.pip('freeze', expect_stderr=True)

    expected = textwrap.dedent("""\
        Script result: pip freeze
        -- stdout: --------------------
        ...-e %[email protected]#egg=INITools-0.3.1dev...-dev_r10
        ...""" % checkout_path)
    _check_output(result, expected)
开发者ID:bobobo1618,项目名称:heroku-buildpack-python,代码行数:33,代码来源:test_freeze.py

示例14: test_download_editable_to_custom_path

def test_download_editable_to_custom_path(script, tmpdir):
    """
    Test downloading an editable using a relative custom src folder.
    """
    script.scratch_path.join("customdl").mkdir()
    result = script.pip(
        'install',
        '-e',
        '%s#egg=initools-dev' %
        local_checkout(
            'svn+http://svn.colorstudy.com/INITools/trunk',
            tmpdir.join("cache")
        ),
        '--src',
        'customsrc',
        '--download',
        'customdl',
    )
    customsrc = Path('scratch') / 'customsrc' / 'initools'
    assert customsrc in result.files_created, (
        sorted(result.files_created.keys())
    )
    assert customsrc / 'setup.py' in result.files_created, (
        sorted(result.files_created.keys())
    )

    customdl = Path('scratch') / 'customdl' / 'initools'
    customdl_files_created = [
        filename for filename in result.files_created
        if filename.startswith(customdl)
    ]
    assert customdl_files_created
开发者ID:MathewJennings,项目名称:pip,代码行数:32,代码来源:test_install.py

示例15: test_git_with_non_editable_where_egg_contains_dev_string

def test_git_with_non_editable_where_egg_contains_dev_string(script, tmpdir):
    """
    Test cloning a git repository from a non-editable url which contains "dev" string
    """
    result = script.pip('install', '%s#egg=django-devserver' %
                     local_checkout('git+git://github.com/dcramer/django-devserver.git', tmpdir.join("cache")))
    devserver_folder = script.site_packages/'devserver'
    assert devserver_folder in result.files_created, str(result)
开发者ID:1stvamp,项目名称:pip,代码行数:8,代码来源:test_install_vcs.py


注:本文中的tests.lib.local_repos.local_checkout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。