Skip to content

Commit 1cb99c1

Browse files
authored
Merge pull request #4877 from edmorley/markers-ignore-loglevel
Use log level info when ignoring packages due to environment markers
2 parents 01a555e + 4b81388 commit 1cb99c1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

news/4876.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use log level `info` instead of `warning` when ignoring packages due to environment markers.

src/pip/_internal/req/req_set.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ def add_requirement(self, install_req, parent_req_name=None,
5959
already be added. Note that None implies that this is a user
6060
supplied requirement, vs an inferred one.
6161
:param extras_requested: an iterable of extras used to evaluate the
62-
environement markers.
62+
environment markers.
6363
:return: Additional requirements to scan. That is either [] if
6464
the requirement is not applicable, or [install_req] if the
6565
requirement is applicable and has just been added.
6666
"""
6767
name = install_req.name
6868
if not install_req.match_markers(extras_requested):
69-
logger.warning("Ignoring %s: markers '%s' don't match your "
70-
"environment", install_req.name,
71-
install_req.markers)
69+
logger.info("Ignoring %s: markers '%s' don't match your "
70+
"environment", install_req.name,
71+
install_req.markers)
7272
return []
7373

7474
# This check has to come after we filter requirements with the

tests/functional/test_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,10 +1202,10 @@ def test_basic_install_environment_markers(script):
12021202
)
12031203
"""))
12041204

1205-
res = script.pip('install', '--no-index', pkga_path, expect_stderr=True)
1205+
res = script.pip('install', '--no-index', pkga_path)
12061206
# missing_pkg should be ignored
12071207
assert ("Ignoring missing-pkg: markers 'python_version == \"1.0\"' don't "
1208-
"match your environment") in res.stderr, str(res)
1208+
"match your environment") in res.stdout, str(res)
12091209
assert "Successfully installed pkga-0.1" in res.stdout, str(res)
12101210

12111211

tests/functional/test_install_reqs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,10 @@ def test_install_unsupported_wheel_link_with_marker(script):
484484
result = script.pip(
485485
'install', '-r', script.scratch_path / 'with-marker.txt',
486486
expect_error=False,
487-
expect_stderr=True,
488487
)
489488

490489
assert ("Ignoring asdf: markers 'sys_platform == \"xyz\"' don't match "
491-
"your environment") in result.stderr
490+
"your environment") in result.stdout
492491
assert len(result.files_created) == 0
493492

494493

0 commit comments

Comments
 (0)