Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-113299: Move Argument Clinic CLI into libclinic#115542
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
zooba commented Feb 15, 2024
Can we not keep Maybe also consider adding |
erlend-aasland commented Feb 15, 2024
Let's consider it. @AlexWaygood: what do you think, as the author of the patch?
Yes, that is a good idea. |
AlexWaygood commented Feb 15, 2024
Yeah, I agree that makes more sense on the face of it. I think I tried it, but balked because it led to a much bigger diff, essentially destroying |
AlexWaygood commented Feb 15, 2024
Also: thanks so much for picking this up! |
erlend-aasland commented Feb 15, 2024
Ouch, yes that does mess up Git log pretty heavily! |
erlend-aasland commented Feb 15, 2024
Turns out Git becomes extremely confused if we |
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of renaming libclinic to just clinic? And also move __main__.py in the sub-directory?
My intent is to be able to run python -m clinic ... when making the assumption that Tools/clinic/ is in the path.
Previously, "clinic" couldn't be used since Tools/clinic/ already contained clinic.py.
I hope that in the long term, we can provide clinic as part of the stdlib! And clinic sounds like a better name than libclinic.
By the way, while we move files all around, what do you think of renaming clinic to argclinic?
erlend-aasland commented Feb 16, 2024
Something like this? $ ls -lR Tools/clinictotal 24drwxr-xr-x 10 erlend.aasland staff 320 Feb 16 09:11 clinic-rw-r--r-- 1 erlend.aasland staff 266 Jan 17 12:58 mypy.iniTools/clinic/clinic:total 536-rw-r--r-- 1 erlend.aasland staff 1413 Feb 16 09:07 __init__.py-rw-r--r-- 1 erlend.aasland staff 70 Feb 16 09:11 __main__.py-rw-r--r-- 1 erlend.aasland staff 6361 Feb 16 09:11 cli.py-rw-r--r-- 1 erlend.aasland staff 229513 Feb 16 09:11 clinic.py-rw-r--r-- 1 erlend.aasland staff 5918 Feb 15 23:59 cpp.py-rw-r--r-- 1 erlend.aasland staff 638 Feb 15 23:59 errors.py-rw-r--r-- 1 erlend.aasland staff 6671 Feb 16 09:07 formatting.py-rw-r--r-- 1 erlend.aasland staff 1049 Feb 16 09:07 identifiers.py-rw-r--r-- 1 erlend.aasland staff 1951 Feb 15 23:59 utils.py
Currently, libclinic makes sense (we have clinic.py and a clinic lib with some refactored out code), but I agree it may be a temporary namespace. Here's a quick glance at what we do elsewhere in $ find Tools -name __main__.pyTools/c-analyzer/c_parser/preprocessor/__main__.pyTools/c-analyzer/c_parser/__main__.pyTools/c-analyzer/cpython/__main__.pyTools/c-analyzer/c_analyzer/__main__.pyTools/peg_generator/pegen/__main__.pyYour suggestion aligns with existing practice.
Let the painting begin 🎨🚲😄 My preference would be:
|
erlend-aasland commented Feb 16, 2024
@vstinner: but we are digressing; the linked issue is about refactoring Argument Clinic into smaller and more manageable pieces, and this PR is about separating out the command-line interface. If we want a new Argument Clinic namespace, or make Argument Clinic a part of the stdlib, we should have a broader discussion 😃 Let us not derail further from the PR. |
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you remove __main__.py.
zooba commented Feb 19, 2024
You could use two commits/PRs to handle the Git history. IIUC, Git doesn't track renames, it just calculates them when generating its history. That ought to happen for each commit, so if there's a commit that is clearly a move rather than a big edit, followed by another one that's clearly a move rather than a big edit, it ought to stay happy. You can test with two commits on your own, but because we squash merge, it'll need to be separate PRs. The second one should just be a rename. |
erlend-aasland commented Feb 20, 2024
@zooba, I see I did not clearly explain what I tested in #115542 (comment):
If we don't rename |
zooba commented Feb 20, 2024
Yeah, I guess Git is going to make this painful for everyone regardless of the choice. Personally, calling it |
AlexWaygood commented Feb 20, 2024
|
erlend-aasland commented Feb 20, 2024
Well, there is the option just keeping the CLI in |
erlend-aasland commented Feb 20, 2024
Removed with 730c3f9 |
vstinner commented Feb 21, 2024
Please don't do that :-( If we have a Also, run_clinic.py can live in a different directory, like |
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but be careful of outdated NEWS entry (and maybe the commit message? I didn't check.)
| @@ -0,0 +1,3 @@ | |||
| The Argument Clinic CLI is now invoked as either :program:`python3 | |||
| Tools/clinic` or :program:`python3 Tools/clinic/run_clinic.py`, as | |||
| :file:`Tools/clinic/clinic.py` has been refactored into ``libclinic``. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NEWS entry is outdated, there is no __main__.py script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, thanks; the NEWS entry was not part of the commit I reverted. Good catch.
erlend-aasland commented Feb 21, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@zooba: How about @vstinner's suggestion (a $ python3 Tools/clinic/clinic |
| The Argument Clinic CLI is now invoked as either :program:`python3 | ||
| Tools/clinic` or :program:`python3 Tools/clinic/run_clinic.py`, as | ||
| :file:`Tools/clinic/clinic.py` has been refactored into ``libclinic``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The Argument Clinic CLI is now invoked as either :program:`python3 | |
| Tools/clinic` or :program:`python3 Tools/clinic/run_clinic.py`, as | |
| :file:`Tools/clinic/clinic.py` has been refactored into ``libclinic``. | |
| The Argument Clinic CLI is now invoked as | |
| :program:`python3 Tools/clinic/run_clinic.py`, | |
| since :file:`Tools/clinic/clinic.py` has been refactored into ``libclinic``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I like this NEWS entry.
zooba commented Feb 21, 2024
I'd rather make However, since I don't do either right now, and because |
vstinner commented Feb 21, 2024
I would like to move clinic to the stdlib in the long term, so I would prefer to have |
erlend-aasland commented Apr 3, 2024
Superseded by #117513. |
Uh oh!
There was an error while loading. Please reload this page.