-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
pip-compile --no-header <blank requirements.in> neither creates nor overwrites requirements.txt #900
Comments
Hello @AndydeCleyre, Thanks for the report! That's a good catch! |
I'll submit a pull request for this today. Would it be preferable for the writer line iterator to simply always yield a final extra newline, or to actually keep track of whether or not it has yielded any real lines along the way, and only add the newline in that case? |
I'd prefer this suggestion:
|
…d --no-header is supplied (Fixes jazzband#900) Add !is_empty (yielded) tracking to the writer's _iter_lines method, and yield a blank line (empty string) if (and only if) otherwise nothing at all would be yielded.
If
requirements.in
is empty, runningpip-compile
will create or clobberrequirements.txt
, thereby removing all requirements, but if--no-header
is passed topip-compile
,requirements.txt
will not be affected in any way, no matter its state.Environment Versions
3.7.4
19.2.3
4.1.0
Steps to replicate
full, unexpected:
The text was updated successfully, but these errors were encountered: