Skip to content

Use log level info when ignoring packages due to environment markers #4877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4876.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use log level `info` instead of `warning` when ignoring packages due to environment markers.
8 changes: 4 additions & 4 deletions src/pip/_internal/req/req_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ def add_requirement(self, install_req, parent_req_name=None,
already be added. Note that None implies that this is a user
supplied requirement, vs an inferred one.
:param extras_requested: an iterable of extras used to evaluate the
environement markers.
environment markers.
:return: Additional requirements to scan. That is either [] if
the requirement is not applicable, or [install_req] if the
requirement is applicable and has just been added.
"""
name = install_req.name
if not install_req.match_markers(extras_requested):
logger.warning("Ignoring %s: markers '%s' don't match your "
"environment", install_req.name,
install_req.markers)
logger.info("Ignoring %s: markers '%s' don't match your "
"environment", install_req.name,
install_req.markers)
return []

# This check has to come after we filter requirements with the
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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)


Expand Down
3 changes: 1 addition & 2 deletions tests/functional/test_install_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,10 @@ def test_install_unsupported_wheel_link_with_marker(script):
result = script.pip(
'install', '-r', script.scratch_path / 'with-marker.txt',
expect_error=False,
expect_stderr=True,
)

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


Expand Down