Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
54b81e3a
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
54b81e3a
编写于
8月 19, 2018
作者:
C
Chris Jerdonek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Put more of the URL pattern into _checkout_into_temp().
This addresses a review comment by @pradyunsg.
上级
749c898a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
22 deletion
+23
-22
tests/functional/test_install_vcs_git.py
tests/functional/test_install_vcs_git.py
+23
-22
未找到文件。
tests/functional/test_install_vcs_git.py
浏览文件 @
54b81e3a
...
...
@@ -10,21 +10,24 @@ from tests.lib.git_submodule_helpers import (
from
tests.lib.local_repos
import
local_checkout
def
_checkout_into_temp
(
url
,
temp_dir
,
egg
=
None
):
def
_checkout_into_temp
(
url
_info
,
temp_dir
,
egg
=
None
):
"""
Call local_checkout(), and return the resulting URL.
Call local_checkout()
with a GitHub URL
, and return the resulting URL.
Args:
url: a package URL (e.g. a "git+https://" or "git+git://" URL).
url_info: a pair of strings (scheme, url_path) to create a package URL
by completing the format string "git+{}://github.com/{}".
temp_dir: the pytest tmpdir value.
egg: an optional project name to append to the URL as the egg fragment,
prior to returning.
"""
package_url
=
local_checkout
(
url
,
temp_dir
.
join
(
"cache"
))
scheme
,
url_path
=
url_info
url
=
'git+{}://github.com/{}'
.
format
(
scheme
,
url_path
)
local_url
=
local_checkout
(
url
,
temp_dir
.
join
(
'cache'
))
if
egg
is
not
None
:
package
_url
+=
'#egg={}'
.
format
(
egg
)
local
_url
+=
'#egg={}'
.
format
(
egg
)
return
package
_url
return
local
_url
def
_make_version_pkg_url
(
path
,
rev
=
None
):
...
...
@@ -97,8 +100,8 @@ def test_install_editable_from_git_with_https(script, tmpdir):
"""
Test cloning from Git with https.
"""
url
=
'git+https://github.com/pypa/pip-test-package.git'
local_url
=
_checkout_into_temp
(
url
,
tmpdir
,
egg
=
'pip-test-package'
)
url
_info
=
(
'https'
,
'pypa/pip-test-package.git'
)
local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
,
egg
=
'pip-test-package'
)
result
=
script
.
pip
(
'install'
,
'-e'
,
local_url
,
expect_error
=
True
)
result
.
assert_installed
(
'pip-test-package'
,
with_files
=
[
'.git'
])
...
...
@@ -241,12 +244,12 @@ def test_git_with_tag_name_and_update(script, tmpdir):
"""
Test cloning a git repository and updating to a different version.
"""
url
=
'git+https://github.com/pypa/pip-test-package.git'
local_url
=
_checkout_into_temp
(
url
,
tmpdir
,
egg
=
'pip-test-package'
)
url
_info
=
(
'https'
,
'pypa/pip-test-package.git'
)
local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
,
egg
=
'pip-test-package'
)
result
=
script
.
pip
(
'install'
,
'-e'
,
local_url
,
expect_error
=
True
)
result
.
assert_installed
(
'pip-test-package'
,
with_files
=
[
'.git'
])
new_local_url
=
_checkout_into_temp
(
url
,
tmpdir
)
new_local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
)
new_local_url
+=
'@0.1.2#egg=pip-test-package'
result
=
script
.
pip
(
'install'
,
'--global-option=--version'
,
'-e'
,
new_local_url
,
...
...
@@ -261,8 +264,8 @@ def test_git_branch_should_not_be_changed(script, tmpdir):
Editable installations should not change branch
related to issue #32 and #161
"""
url
=
'git+https://github.com/pypa/pip-test-package.git'
local_url
=
_checkout_into_temp
(
url
,
tmpdir
,
egg
=
'pip-test-package'
)
url
_info
=
(
'https'
,
'pypa/pip-test-package.git'
)
local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
,
egg
=
'pip-test-package'
)
script
.
pip
(
'install'
,
'-e'
,
local_url
,
expect_error
=
True
)
source_dir
=
script
.
venv_path
/
'src'
/
'pip-test-package'
result
=
script
.
run
(
'git'
,
'branch'
,
cwd
=
source_dir
)
...
...
@@ -274,11 +277,9 @@ def test_git_with_non_editable_unpacking(script, tmpdir):
"""
Test cloning a git repository from a non-editable URL with a given tag.
"""
url
=
(
'git+https://github.com/pypa/pip-test-package.git@0.1.2'
'#egg=pip-test-package'
)
local_url
=
_checkout_into_temp
(
url
,
tmpdir
)
url_path
=
'pypa/pip-test-package.git@0.1.2#egg=pip-test-package'
url_info
=
(
'https'
,
url_path
)
local_url
=
_checkout_into_temp
(
url_info
,
tmpdir
)
result
=
script
.
pip
(
'install'
,
'--global-option=--version'
,
local_url
,
expect_error
=
True
,
)
...
...
@@ -291,8 +292,8 @@ 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
"""
url
=
'git+git://github.com/dcramer/django-devserver.git'
local_url
=
_checkout_into_temp
(
url
,
tmpdir
,
egg
=
'django-devserver'
)
url
_info
=
(
'git'
,
'dcramer/django-devserver.git'
)
local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
,
egg
=
'django-devserver'
)
result
=
script
.
pip
(
'install'
,
'-e'
,
local_url
)
result
.
assert_installed
(
'django-devserver'
,
with_files
=
[
'.git'
])
...
...
@@ -303,8 +304,8 @@ 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
"""
url
=
'git+git://github.com/dcramer/django-devserver.git'
local_url
=
_checkout_into_temp
(
url
,
tmpdir
,
egg
=
'django-devserver'
)
url
_info
=
(
'git'
,
'dcramer/django-devserver.git'
)
local_url
=
_checkout_into_temp
(
url
_info
,
tmpdir
,
egg
=
'django-devserver'
)
result
=
script
.
pip
(
'install'
,
local_url
)
devserver_folder
=
script
.
site_packages
/
'devserver'
assert
devserver_folder
in
result
.
files_created
,
str
(
result
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录