-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Refactor Argument Clinic support code into libclinic #113299
Comments
* Create Tools/clinic/clinic/ package * Add Tools/clinic/clinic/__init__.py: export names, most of them are used by tests. * Use vars(module) instead of globals() to get symbols. * Move header (author, license) to clinic/__init__.py. * Add run_clinic.py script in Tools/clinic/. Update "make clinic" and "make clinic-tests" in Makefile.pre.in to use run_clinic.py.
This has also been discussed before. See #104683 (comment). |
I think it is a really good idea to split Moreover, doing this work in chunks/iterations, instead of everything in one go, will minimise the impact on ongoing Argument Clinic work. |
+1 to splitting clinic.py up, and +1 to doing it incrementally rather than in one big PR. Previously I've held off from doing something like this because clinic.py's use of global variables means that lots of parts of the file are tightly coupled to other parts in surprising and unfortunate ways. In #113300, But maybe it's acceptable for now, if splitting the code up into several files is a higher priority :) Getting rid of the global variables is hard! |
IMO, getting rid of the global variables should be a prerequisite to splitting things up. We don't need to rush this; clinic.py has been a single file since it started out in life. Argument Clinic is already hard to comprehend, so any refactoring, including splitting up should make it more readable, not the other way around. Readability is IMO the highest priority. |
* Create Tools/clinic/libclinic/ package. * Move cpp.py to libclinic. * Create libclinic.utils.
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.
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.
This comment was marked as resolved.
This comment was marked as resolved.
Since last week, we've done a lot of yak-shaving (and there is more to be done). A bare bones libclinic has been established, containing most of the stateless formatting code. The next steps will be to move |
|
Superseded by #113317 |
Argument Clinic was added 10 years ago. The script
clinic.py
grown from around 2500 lines to around 6700 lines.I propose to split this large file into sub-files to ease the maintenance of Argument Clinic.
Linked PRs
The text was updated successfully, but these errors were encountered: