未验证 提交 1cb99c1a 编写于 作者: P Paul Moore 提交者: GitHub

Merge pull request #4877 from edmorley/markers-ignore-loglevel

Use log level info when ignoring packages due to environment markers
Use log level `info` instead of `warning` when ignoring packages due to environment markers.
...@@ -59,14 +59,14 @@ class RequirementSet(object): ...@@ -59,14 +59,14 @@ class RequirementSet(object):
already be added. Note that None implies that this is a user already be added. Note that None implies that this is a user
supplied requirement, vs an inferred one. supplied requirement, vs an inferred one.
:param extras_requested: an iterable of extras used to evaluate the :param extras_requested: an iterable of extras used to evaluate the
environement markers. environment markers.
:return: Additional requirements to scan. That is either [] if :return: Additional requirements to scan. That is either [] if
the requirement is not applicable, or [install_req] if the the requirement is not applicable, or [install_req] if the
requirement is applicable and has just been added. requirement is applicable and has just been added.
""" """
name = install_req.name name = install_req.name
if not install_req.match_markers(extras_requested): if not install_req.match_markers(extras_requested):
logger.warning("Ignoring %s: markers '%s' don't match your " logger.info("Ignoring %s: markers '%s' don't match your "
"environment", install_req.name, "environment", install_req.name,
install_req.markers) install_req.markers)
return [] return []
......
...@@ -1202,10 +1202,10 @@ def test_basic_install_environment_markers(script): ...@@ -1202,10 +1202,10 @@ def test_basic_install_environment_markers(script):
) )
""")) """))
res = script.pip('install', '--no-index', pkga_path, expect_stderr=True) res = script.pip('install', '--no-index', pkga_path)
# missing_pkg should be ignored # missing_pkg should be ignored
assert ("Ignoring missing-pkg: markers 'python_version == \"1.0\"' don't " assert ("Ignoring missing-pkg: markers 'python_version == \"1.0\"' don't "
"match your environment") in res.stderr, str(res) "match your environment") in res.stdout, str(res)
assert "Successfully installed pkga-0.1" in res.stdout, str(res) assert "Successfully installed pkga-0.1" in res.stdout, str(res)
......
...@@ -484,11 +484,10 @@ def test_install_unsupported_wheel_link_with_marker(script): ...@@ -484,11 +484,10 @@ def test_install_unsupported_wheel_link_with_marker(script):
result = script.pip( result = script.pip(
'install', '-r', script.scratch_path / 'with-marker.txt', 'install', '-r', script.scratch_path / 'with-marker.txt',
expect_error=False, expect_error=False,
expect_stderr=True,
) )
assert ("Ignoring asdf: markers 'sys_platform == \"xyz\"' don't match " assert ("Ignoring asdf: markers 'sys_platform == \"xyz\"' don't match "
"your environment") in result.stderr "your environment") in result.stdout
assert len(result.files_created) == 0 assert len(result.files_created) == 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册