本文整理匯總了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',
],
}