Skip to content

Commit e14c4cd

Browse files
authored
Merge pull request #1894 from atugushev/verbose-config-log
Downgrade log level for configuration defaults message
2 parents e8b8ce7 + e625695 commit e14c4cd

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

piptools/scripts/compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def cli(
410410
)
411411

412412
if config:
413-
log.info(f"Using pip-tools configuration defaults found in '{config !s}'.")
413+
log.debug(f"Using pip-tools configuration defaults found in '{config !s}'.")
414414

415415
if resolver_name == "legacy":
416416
log.warning(

piptools/scripts/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def cli(
147147
sys.exit(2)
148148

149149
if config:
150-
log.info(f"Using pip-tools configuration defaults found in '{config !s}'.")
150+
log.debug(f"Using pip-tools configuration defaults found in '{config !s}'.")
151151

152152
if python_executable:
153153
_validate_python_executable(python_executable)

tests/test_cli_compile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,3 +2925,15 @@ def test_compile_recursive_extras(runner, tmp_path, current_resolver):
29252925
"""
29262926
assert out.exit_code == 0
29272927
assert expected == out.stderr
2928+
2929+
2930+
def test_config_option(pip_conf, runner, tmp_path, make_config_file):
2931+
config_file = make_config_file("dry-run", True)
2932+
2933+
req_in = tmp_path / "requirements.in"
2934+
req_in.touch()
2935+
2936+
out = runner.invoke(cli, [req_in.as_posix(), "--config", config_file.as_posix()])
2937+
2938+
assert out.exit_code == 0
2939+
assert "Dry-run, so nothing updated" in out.stderr

tests/test_cli_sync.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,16 @@ def test_default_python_executable_option(run, runner):
372372
"-r",
373373
]
374374
]
375+
376+
377+
@mock.patch("piptools.sync.run")
378+
def test_config_option(run, runner, make_config_file):
379+
config_file = make_config_file("dry-run", True)
380+
381+
with open(sync.DEFAULT_REQUIREMENTS_FILE, "w") as reqs_txt:
382+
reqs_txt.write("six==1.10.0")
383+
384+
out = runner.invoke(cli, ["--config", config_file.as_posix()])
385+
386+
assert out.exit_code == 1
387+
assert "Would install:" in out.stdout

0 commit comments

Comments
 (0)