Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve punctuation/grammar with pip-compile header #1547

Merged
merged 7 commits into from Nov 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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