From dc232c990769baa185bcd92bd26966bc91c5cca6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 26 Dec 2021 16:22:47 +0100 Subject: [PATCH 1/4] Improve punctuation/grammar with header. --- piptools/writer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piptools/writer.py b/piptools/writer.py index 0c5e47489..134d41b16 100644 --- a/piptools/writer.py +++ b/piptools/writer.py @@ -116,10 +116,10 @@ def write_header(self) -> Iterator[str]: if self.emit_header: yield comment("#") yield comment( - "# This file is autogenerated by pip-compile with python " - f"{sys.version_info.major}.{sys.version_info.minor}" + "# This file is autogenerated by pip-compile with Python " + f"{sys.version_info.major}.{sys.version_info.minor}." ) - yield comment("# To update, run:") + yield comment("# To update it, run:") yield comment("#") compile_command = os.environ.get( "CUSTOM_COMPILE_COMMAND" From f1fd30bcb71105262ff37987780cad2f8822df36 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 6 Oct 2022 10:24:29 +0100 Subject: [PATCH 2/4] Update piptools/writer.py Co-authored-by: Hugo van Kemenade --- piptools/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piptools/writer.py b/piptools/writer.py index 134d41b16..68193533b 100644 --- a/piptools/writer.py +++ b/piptools/writer.py @@ -119,7 +119,7 @@ def write_header(self) -> Iterator[str]: "# This file is autogenerated by pip-compile with Python " f"{sys.version_info.major}.{sys.version_info.minor}." ) - yield comment("# To update it, run:") + yield comment("# To update, run:") yield comment("#") compile_command = os.environ.get( "CUSTOM_COMPILE_COMMAND" From 8379080b02d17dae4f2d468afce19a09bcc827c3 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sun, 20 Nov 2022 17:07:15 +0000 Subject: [PATCH 3/4] Update piptools/writer.py Co-authored-by: Albert Tugushev --- piptools/writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piptools/writer.py b/piptools/writer.py index 3f0c211b2..bc9f5ec2f 100644 --- a/piptools/writer.py +++ b/piptools/writer.py @@ -133,9 +133,9 @@ def write_header(self) -> Iterator[str]: yield comment("#") yield comment( "# This file is autogenerated by pip-compile with Python " - f"{sys.version_info.major}.{sys.version_info.minor}." + f"{sys.version_info.major}.{sys.version_info.minor}" ) - yield comment("# To update, run:") + yield comment("# by the following command:") yield comment("#") compile_command = os.environ.get( "CUSTOM_COMPILE_COMMAND" From 24c44b72d02a7d292bc5da0512442ceac5387e04 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Sun, 20 Nov 2022 19:56:14 +0100 Subject: [PATCH 4/4] Fix tests --- tests/test_cli_compile.py | 11 ++--------- tests/test_writer.py | 8 ++++---- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py index 95dd3244e..69185354b 100644 --- a/tests/test_cli_compile.py +++ b/tests/test_cli_compile.py @@ -1758,17 +1758,10 @@ def test_upgrade_package_doesnt_remove_annotation(pip_conf, runner): "small-fake-a==0.1 # via small-fake-with-deps\n" ) - runner.invoke(cli, ["-P", "small-fake-a", "--no-emit-find-links"]) + runner.invoke(cli, ["-P", "small-fake-a", "--no-emit-options", "--no-header"]) with open("requirements.txt") as req_txt: assert req_txt.read() == dedent( - f"""\ - # - # This file is autogenerated by pip-compile with python \ -{sys.version_info.major}.{sys.version_info.minor} - # To update, run: - # - # pip-compile --no-emit-find-links - # + """\ small-fake-a==0.1 # via small-fake-with-deps small-fake-with-deps==0.1 diff --git a/tests/test_writer.py b/tests/test_writer.py index 1955829a0..91b7b195d 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -192,9 +192,9 @@ def test_write_header(writer): comment, [ "#", - "# This file is autogenerated by pip-compile with python " + "# This file is autogenerated by pip-compile with Python " f"{sys.version_info.major}.{sys.version_info.minor}", - "# To update, run:", + "# by the following command:", "#", "# pip-compile --output-file={} src_file src_file2".format( writer.click_ctx.params["output_file"].name @@ -211,9 +211,9 @@ def test_write_header_custom_compile_command(writer, monkeypatch): comment, [ "#", - "# This file is autogenerated by pip-compile with python " + "# This file is autogenerated by pip-compile with Python " f"{sys.version_info.major}.{sys.version_info.minor}", - "# To update, run:", + "# by the following command:", "#", "# ./pipcompilewrapper", "#",