Skip to content

Commit

Permalink
Improve punctuation/grammar with header. (#1547)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Albert Tugushev <albert@tugushev.ru>
Co-authored-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
  • Loading branch information
4 people committed Nov 20, 2022
1 parent e53042b commit 7957dc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions piptools/writer.py
Expand Up @@ -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"
Expand Down
11 changes: 2 additions & 9 deletions tests/test_cli_compile.py
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/test_writer.py
Expand Up @@ -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
Expand All @@ -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",
"#",
Expand Down

0 comments on commit 7957dc9

Please sign in to comment.