Skip to content

Extract CLI logic from clinic.py #34

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

Closed
wants to merge 11 commits into from
Closed

Extract CLI logic from clinic.py #34

wants to merge 11 commits into from

Conversation

AlexWaygood
Copy link

  • Move Tools/clinic/clinic.py and Tools/clinic/cpp.py inside the Tools/clinic/libclinic package.
  • Extract the CLI logic from clinic.py into a new libclinic submodule, libclinic.cli
  • Add a new file, Tools/clinic/run_clinic.py, which simply imports libclinic.cli and executes the CLI if __name__ == "__main__". Update the Makefile etc. so that they run Tools/clinic/run_clinic.py instead of Tools/clinic/clinic.py.

@erlend-aasland
Copy link

Nice

@AlexWaygood AlexWaygood marked this pull request as ready for review December 23, 2023 17:05
@AlexWaygood
Copy link
Author

(I'll probably not get back to this until 27th now — will upstream this then :)

@erlend-aasland
Copy link

(I'll probably not get back to this until 27th now — will upstream this then :)

Enjoy the days off 🎅🎄🎉

@erlend-aasland
Copy link

Hm, I think parse_file() should live where the CLI lives; it is an app function, not a library function.

@erlend-aasland
Copy link

What do you think of this, @vstinner?

Copy link

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@erlend-aasland
Copy link

Upstream as python#115542

@erlend-aasland erlend-aasland deleted the extract-cli branch February 15, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants