Skip to content
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

Add turtle module into installion option tcl/tk #125729

Open
CoderTCY opened this issue Oct 19, 2024 · 8 comments
Open

Add turtle module into installion option tcl/tk #125729

CoderTCY opened this issue Oct 19, 2024 · 8 comments
Labels
OS-windows type-feature A feature request or enhancement

Comments

@CoderTCY
Copy link

CoderTCY commented Oct 19, 2024

Feature or enhancement

Proposal:

Just as the title said, add turtle module into the option in the picture:
pic
Because the turtle module is a tool requiring tkinter, why should it added since the user didn't want to install tkinter?

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

@CoderTCY CoderTCY added the type-feature A feature request or enhancement label Oct 19, 2024
@CoderTCY
Copy link
Author

CoderTCY commented Oct 19, 2024

This is a literal description level problem, and not installing tcl/tk will cancel the installation of turtle. I don't think that's necessary. Should we add both tkinter turtle turtledemo IDLE

https://github.com/python/cpython/blob/main/PC/layout/main.py#L39-L40

But I still found turtle.py in Lib folder even I didn't tick the option, is it a bug? (Tested in 3.13.0)
And sorry for my poor english _

@Wulian233
Copy link
Contributor

I sorry for my mistake. You were right. Unchecking tcl/tk will remove the installation of turtledemo,

https://github.com/python/cpython/blob/main/Tools%2Fmsi%2Ftcltk%2Ftcltk.wixproj#L31-L31

but turtle will still be installed. However, turtle depends on tkinter.
https://github.com/python/cpython/blob/main/Lib%2Fturtle.py#L101-L101

@CoderTCY CoderTCY changed the title Add turtle into tkinter installion option Add turtle module into tkinter installion option Oct 20, 2024
@terryjreedy
Copy link
Member

I have informally suggested this somewhere once, but never made an issue. It seems sensible, so thanks. I do not know the situation on Mac, so included it also. What *nix distributions do is out of our hands.

What does turtle do when import turtle fails?

I believe that there is some tkinter code somewhere in tools. If so, it should fail gracefully. IDLE tries to fail gracefully (write a message) if import tkinter fails and it was started from a console in such a way that there is a sys.__stdout__ to write to. Tools may not be installed anyway; are more likely to be started from a terminal; and have less bulk that turtle; so omitting them seems less important.

@CoderTCY CoderTCY changed the title Add turtle module into tkinter installion option Add turtle module into installion option tcl/tk Oct 20, 2024
@zooba
Copy link
Member

zooba commented Oct 21, 2024

Is the proposal here to list "turtle" as something that is added/removed with the Tcl/Tk option (that is, update the text in the installer)? Or do we need to actually make it add/remove with that option (that is, update the behaviour of the installer)?

I'm pretty sure we stopped distributing the Tools directory a while ago.

@terryjreedy
Copy link
Member

Both:

  1. Omit turtle along with idlelib and turtledemo when tck/tk and (_)tkinter are omitted. (Two people say above that this is not the case now. Turtle is installed when it cannot run.)
  2. Modify label: "tcl/tk, tkinter, IDLE, and turtle" and desciption: "Installs tkinter, turtle, and the IDLE development environment."

I an not sure what happens on Macs.

@ned-deily
Copy link
Member

I a not sure what happens on Macs.

The Python for macOS installers we provide on python.org do not have an option to not install tkinter, IDLE, or turtle.

@terryjreedy
Copy link
Member

Thanks. Then this is Windows only.

@CoderTCY
Copy link
Author

CoderTCY commented Oct 22, 2024

Is the proposal here to list "turtle" as something that is added/removed with the Tcl/Tk option (that is, update the text in the installer)? Or do we need to actually make it add/remove with that option (that is, update the behaviour of the installer)?

I'm pretty sure we stopped distributing the Tools directory a while ago.

Just like @terryjreedy said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants