Implement a --group flag for dependency-group parsing for pip-compile#2175
Implement a --group flag for dependency-group parsing for pip-compile#2175sirosen wants to merge 6 commits intojazzband:mainfrom
--group flag for dependency-group parsing for pip-compile#2175Conversation
Define the option, but don't implement any behavior other than parsing yet. This is defined very similarly to `--group` for `pip` commands, but allows for a double-colon as a delimiter, rather than requiring only one.
Import and adapt the dependency-groups support code from within pip, for use in the pip-compile CLI context.
When parsing `--group` inputs, use a custom type to record the input argument value. This allows the writer to more accurately reproduce the input command as part of the output.
And apply fixes and changes as required. Tests include a simple positive test case and a number of error checking cases for different scenarios. Minor fixes to output are needed and `--group` is treated as an alternative to having a source file when determining whether or not sufficient input options were given.
|
@reactive-firewall did you generate that with an LLM? |
|
I was wondering the same thing. It has a clear split between what looks like generated junk at the start and a small human comment at the end. @reactive-firewall, FYI we are currently working on an LLM usage policy which includes a requirement of disclosure when these tools are used. Please make sure that your comments are making a meaningful contribution. Remember that they take time and effort to read and respond to, and many projects have extremely limited resources -- a few hours per week from one or two people. Spending even half an hour writing a good reply is a significant chunk of my time budget for open source work. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Okay, I'm going to wait a day and mark these off-topic. @reactive-firewall, I know this thread probably doesn't feel great for you, so I want to make sure we part on the best terms possible. One thing I'll note is that the bulleted list, all with emojis, all with the same starting formula, is a bit of a red flag. I also stand by what I said that I don't know that any of those three bullet points add anything. The first recapitulates literally the first line of the PR description, |
Resolves #2062 1
This is an initial proposed implementation, but even after finishing it, I have two major outstanding questions.
Q1: Should
--groupbe considered a source file?I didn't merge parsed
--groupinputs intosrc_files, but I did countlen(src_files) + len(groups)in a couple of contexts to make it behave similarly.I'm not sure if this was the right approach, or if I missed or misunderstood the goals of the
src_fileschecking in any way.Extra attention in this area during review would be appreciated -- as a new contributor, I did my best to follow the existing code and keep the changes small, but may have made mistakes.
Q2: What tests are missing?
The iniital tests are pretty simple and limited. Probably, more tests would be worthwhile, but it's hard to tell what cases would be useful vs redundant with existing tests.
What additional checks seem important?
Note: Accepts
pyproject.toml:Xandpyproject.toml::XBoth
:and::syntax are accepted, noted in helptext with double-:as[pyproject-path::]groupname.I decided on this after weighing the options from #2062 and would be willing to adjust if there's a strong objection, but think this is the best approach.
pip-compilecan have its own syntax, but accepting thepip installsyntax is an easy gain for compatibility.Because the filename part is already optional, the behavior which handles output of options also naturally handles the
:vs::variation.Commits
--grouptopip-compileoptionsChecklists
Contributor checklist
Maintainer checklist
backwards incompatible,feature,enhancement,deprecation,bug,dependency,docsorskip-changelogas they determine changelog listing.Footnotes
Aside: sorry it took so long to submit a PR! This has been on my to-do list for a while. ↩