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

Allow comments after all requirements.txt entries #3018

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

charliermarsh
Copy link
Member

Summary

I'm surprised we haven't hit this before, but apparently we don't allow comments after --index-url, -e entries, etc., in the requirements.txt parser.

Closes #3011.

Test Plan

cargo test

@charliermarsh charliermarsh marked this pull request as ready for review April 12, 2024 19:03
@@ -801,9 +799,7 @@ fn parse_requirement_and_hashes(
})?;

let hashes = if has_hashes {
let hashes = parse_hashes(content, s)?;
eat_trailing_line(content, s)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.

@@ -581,7 +581,6 @@ fn parse_entry(
Ok(Some(if s.eat_if("-r") || s.eat_if("--requirement") {
let requirements_file = parse_value(content, s, |c: char| !['\n', '\r', '#'].contains(&c))?;
let end = s.cursor();
eat_trailing_line(content, s)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.

@@ -590,19 +589,18 @@ fn parse_entry(
} else if s.eat_if("-c") || s.eat_if("--constraint") {
let constraints_file = parse_value(content, s, |c: char| !['\n', '\r', '#'].contains(&c))?;
let end = s.cursor();
eat_trailing_line(content, s)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary, I think, because the next step after parsing an entry is to eat the trailing line.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 12, 2024
@charliermarsh charliermarsh merged commit 3ae35ad into main Apr 12, 2024
37 checks passed
@charliermarsh charliermarsh deleted the charlie/comment branch April 12, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv install -r … fails with comment in -e ./local_package # via other_package
2 participants