Repository: jazzband/pip-tools

Issue:
The banner in the generated requirements.txt is confusing
When I use pip-compile to generate a requirements.txt file, it includes this banner at the top:

```
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
#    pip-compile --no-emit-index-url
```

However, without the `--upgrade` argument, that command won't generate a new requirements.txt file, unless the setup.py changes. It sounds like it's the distinction between _updating_ the file vs _upgrading_ the packages pinned in the file. As a new user, I found that confusing when subsequent runs of pip-compile weren't picking up upgraded packages.

Ref: https://github.com/jazzband/pip-tools/blob/master/README.rst?plain=1#L64-L68




Discussion:

Resolving patch:
diff --git a/piptools/writer.py b/piptools/writer.py
--- a/piptools/writer.py
+++ b/piptools/writer.py
@@ -123,10 +123,10 @@ def write_header(self) -> Iterator[str]:
         if self.emit_header:
             yield comment("#")
             yield 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}"
             )
-            yield comment("# To update, run:")
+            yield comment("# by the following command:")
             yield comment("#")
             compile_command = os.environ.get(
                 "CUSTOM_COMPILE_COMMAND"


Test patch:
diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py
--- 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
--- 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",
             "#",