Add dedicated warning for empty stdin (#9256)

## Summary

I ran into this in practice:

![Screenshot 2024-11-19 at 4 20
37 PM](https://github.com/user-attachments/assets/d89aa9f1-828a-492e-af5a-3434e277580e)
This commit is contained in:
Charlie Marsh 2024-11-19 17:52:41 -05:00 committed by GitHub
parent 9fb7f81738
commit f4799d2346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,10 +220,14 @@ impl RequirementsTxt {
error: err,
})?;
if data == Self::default() {
warn_user!(
"Requirements file {} does not contain any dependencies",
requirements_txt.user_display()
);
if requirements_txt == Path::new("-") {
warn_user!("No dependencies found in stdin");
} else {
warn_user!(
"Requirements file {} does not contain any dependencies",
requirements_txt.user_display()
);
}
}
Ok(data)