GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-113299: Move Argument Clinic CLI into libclinic by erlend-aasland · Pull Request #115542 · python/cpython Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Can we not keep Maybe also consider adding |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Let's consider it. @AlexWaygood: what do you think, as the author of the patch?
Yes, that is a good idea. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Also: thanks so much for picking this up! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ouch, yes that does mess up Git log pretty heavily! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Turns out Git becomes extremely confused if we |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Something like this? $ ls -lR Tools/clinic total 24 drwxr-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.ini Tools/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__.py Tools/c-analyzer/c_parser/preprocessor/__main__.py Tools/c-analyzer/c_parser/__main__.py Tools/c-analyzer/cpython/__main__.py Tools/c-analyzer/c_analyzer/__main__.py Tools/peg_generator/pegen/__main__.py Your suggestion aligns with existing practice.
Let the painting begin 🎨🚲😄 My preference would be:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you remove __main__.py.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@zooba, I see I did not clearly explain what I tested in #115542 (comment):
If we don't rename |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah, I guess Git is going to make this painful for everyone regardless of the choice. Personally, calling it |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Well, there is the option just keeping the CLI in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This reverts commit 95a59d7.
Removed with 730c3f9 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Please don't do that :-( If we have a Also, run_clinic.py can live in a different directory, like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -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.
The reason will be displayed to describe this comment to others. Learn more.
The NEWS entry is outdated, there is no __main__.py script.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
@zooba: How about @vstinner's suggestion (a $ python3 Tools/clinic/clinic |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 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.
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``. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yep, I like this NEWS entry.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'd rather make However, since I don't do either right now, and because |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I would like to move clinic to the stdlib in the long term, so I would prefer to have |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by #117513. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.