本文整理汇总了Python中conda.history.History._parse_comment_line方法的典型用法代码示例。如果您正苦于以下问题:Python History._parse_comment_line方法的具体用法?Python History._parse_comment_line怎么用?Python History._parse_comment_line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conda.history.History
的用法示例。
在下文中一共展示了History._parse_comment_line方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_specs_line_parsing_44
# 需要导入模块: from conda.history import History [as 别名]
# 或者: from conda.history.History import _parse_comment_line [as 别名]
def test_specs_line_parsing_44(self):
# New format (>=4.4)
item = History._parse_comment_line("# update specs: [\"param[version='>=1.5.1,<2.0']\"]")
pprint(item)
assert item == {
"action": "update",
"specs": [
"param[version='>=1.5.1,<2.0']",
],
"update_specs": [
"param[version='>=1.5.1,<2.0']",
],
}
示例2: test_conda_comment_version_parsing
# 需要导入模块: from conda.history import History [as 别名]
# 或者: from conda.history.History import _parse_comment_line [as 别名]
def test_conda_comment_version_parsing(self):
assert History._parse_comment_line("# conda version: 4.5.1") == {"conda_version": "4.5.1"}
assert History._parse_comment_line("# conda version: 4.5.1rc1") == {"conda_version": "4.5.1rc1"}
assert History._parse_comment_line("# conda version: 4.5.1dev0") == {"conda_version": "4.5.1dev0"}
示例3: test_specs_line_parsing_43
# 需要导入模块: from conda.history import History [as 别名]
# 或者: from conda.history.History import _parse_comment_line [as 别名]
def test_specs_line_parsing_43(self):
# Old format (<4.4)
item = History._parse_comment_line('# install specs: param >=1.5.1,<2.0')
pprint(item)
assert item == {
'action': 'install',
'specs': [
'param >=1.5.1,<2.0',
],
'update_specs': [
'param >=1.5.1,<2.0',
],
}
item = History._parse_comment_line('# install specs: param >=1.5.1,<2.0,0packagename >=1.0.0,<2.0')
pprint(item)
assert item == {
'action': 'install',
'specs': [
'param >=1.5.1,<2.0',
'0packagename >=1.0.0,<2.0',
],
'update_specs': [
'param >=1.5.1,<2.0',
'0packagename >=1.0.0,<2.0',
],
}
item = History._parse_comment_line('# install specs: python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0,numpy >=1.11.0,<2.0,pandas >=0.19.2,<1.0,psycopg2 >=2.6.1,<3.0,pyyaml >=3.12,<4.0,scipy >=0.17.0,<1.0')
pprint(item)
assert item == {
'action': 'install',
'specs': [
'python>=3.5.1',
'jupyter >=1.0.0,<2.0',
'matplotlib >=1.5.1,<2.0',
'numpy >=1.11.0,<2.0',
'pandas >=0.19.2,<1.0',
'psycopg2 >=2.6.1,<3.0',
'pyyaml >=3.12,<4.0',
'scipy >=0.17.0,<1.0',
],
'update_specs': [
'python>=3.5.1',
'jupyter >=1.0.0,<2.0',
'matplotlib >=1.5.1,<2.0',
'numpy >=1.11.0,<2.0',
'pandas >=0.19.2,<1.0',
'psycopg2 >=2.6.1,<3.0',
'pyyaml >=3.12,<4.0',
'scipy >=0.17.0,<1.0',
],
}
item = History._parse_comment_line('# install specs: _license >=1.0.0,<2.0')
pprint(item)
assert item == {
'action': 'install',
'specs': [
'_license >=1.0.0,<2.0',
],
'update_specs': [
'_license >=1.0.0,<2.0',
],
}
item = History._parse_comment_line('# install specs: pandas,_license >=1.0.0,<2.0')
pprint(item)
assert item == {
'action': 'install',
'specs': [
'pandas', '_license >=1.0.0,<2.0',
],
'update_specs': [
'pandas', '_license >=1.0.0,<2.0',
],
}