• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python local_repos.local_checkout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: test_vcs_url_final_slash_normalization

def test_vcs_url_final_slash_normalization(script, tmpdir):
    """
    Test that presence or absence of final slash in VCS URL is normalized.
    """
    result = script.pip('install', '-e',
                     '%s/#egg=ScriptTest' %
                     local_checkout('hg+https://bitbucket.org/ianb/scripttest', tmpdir.join("cache")),
                     expect_error=True)
    assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes
开发者ID:ZeerDonker,项目名称:pip,代码行数:9,代码来源:test_install.py


示例17: test_install_editable_from_svn

def test_install_editable_from_svn(script, tmpdir):
    """
    Test checking out from svn.
    """
    result = script.pip('install',
                     '-e',
                     '%s#egg=initools-dev' %
                     local_checkout('svn+http://svn.colorstudy.com/INITools/trunk', tmpdir.join("cache")))
    result.assert_installed('INITools', with_files=['.svn'])
开发者ID:ZeerDonker,项目名称:pip,代码行数:9,代码来源:test_install.py


示例18: test_install_global_option_using_editable

def test_install_global_option_using_editable(script, tmpdir):
    """
    Test using global distutils options, but in an editable installation
    """
    url = 'hg+http://bitbucket.org/runeh/anyjson'
    result = script.pip('install', '--global-option=--version',
                     '-e', '%[email protected]#egg=anyjson' %
                      local_checkout(url, tmpdir.join("cache")))
    assert '0.2.5\n' in result.stdout
开发者ID:ZeerDonker,项目名称:pip,代码行数:9,代码来源:test_install.py


示例19: test_vcs_url_urlquote_normalization

def test_vcs_url_urlquote_normalization(script, tmpdir):
    """
    Test that urlquoted characters are normalized for repo URL comparison.
    """
    result = script.pip('install', '-e',
                     '%s/#egg=django-wikiapp' %
                     local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1', tmpdir.join("cache")),
                     expect_error=True)
    assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes
开发者ID:ZeerDonker,项目名称:pip,代码行数:9,代码来源:test_install.py


示例20: test_install_subversion_usersite_editable_with_distribute

 def test_install_subversion_usersite_editable_with_distribute(self, script, virtualenv, tmpdir):
     """
     Test installing current directory ('.') into usersite after installing distribute
     """
     virtualenv.system_site_packages = True
     result = script.pip('install', '--user', '-e',
                      '%s#egg=initools-dev' %
                      local_checkout('svn+http://svn.colorstudy.com/INITools/trunk', tmpdir.join("cache")))
     result.assert_installed('INITools', use_user_site=True)
开发者ID:1stvamp,项目名称:pip,代码行数:9,代码来源:test_install_user.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python path.Path类代码示例发布时间:2022-05-27
下一篇:
Python config_mock.swap_attributes函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap