From b3cf3121c6819bcc984b6d8012bd5d6229357cbf Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:25:01 +0200 Subject: [PATCH 01/11] Spell out IDE on first use --- Doc/using/mac.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index eb1413af2cbc3df..f48413a4d5c182b 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -10,7 +10,8 @@ Using Python on a Mac Python on a Mac running macOS is in principle very similar to Python on any other Unix platform, but there are a number of additional features such as -the IDE and the Package Manager that are worth pointing out. +the integrated development environment (IDE) and the Package Manager that are +worth pointing out. .. _getting-osx: From 5c662faf8087819fd291617a789982c8339ed7ad Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:27:34 +0200 Subject: [PATCH 02/11] Elide 'on the Mac' for subheadings --- Doc/using/mac.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index f48413a4d5c182b..06775c9a47a0314 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -131,8 +131,10 @@ This section has moved to the `Python Packaging User Guide`_. .. _Python Packaging User Guide: https://packaging.python.org/en/latest/tutorials/installing-packages/ -GUI Programming on the Mac -========================== +.. _gui-programming-on-the-mac: + +GUI Programming +=============== There are several options for building GUI applications on the Mac with Python. @@ -153,8 +155,10 @@ macOS. More information can be found at https://riverbankcomputing.com/software/pyqt/intro. -Distributing Python Applications on the Mac -=========================================== +.. _distributing-python-applications-on-the-mac: + +Distributing Python Applications +================================ The standard tool for deploying standalone Python applications on the Mac is :program:`py2app`. More information on installing and using py2app can be found From 340ba637443d50b164bb94db89fc598793db8d18 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:29:18 +0200 Subject: [PATCH 03/11] PPC is long gone, Intel is now legacy, universal2 is here --- Doc/using/mac.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 06775c9a47a0314..960d6b1d88a15b5 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -20,10 +20,10 @@ Getting and Installing MacPython macOS used to come with Python 2.7 pre-installed between versions 10.8 and `12.3 `_. -You are invited to install the most recent version of Python 3 from the Python -website (https://www.python.org). A current "universal binary" build of Python, -which runs natively on the Mac's new Intel and legacy PPC CPU's, is available -there. +You are invited to install the most recent version of Python 3 from the `Python +website `__. +A current "universal2 binary" build of Python, which runs natively on the Mac's +new Apple Silicon and legacy Intel processors, is available there. What you get after installing is a number of things: From a1cc5f8fa0ab88b39682f0ad568bde129bfba81f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:31:05 +0200 Subject: [PATCH 04/11] Just call it Python, not MacPython --- Doc/using/mac.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 960d6b1d88a15b5..0377da73bb6549e 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -13,10 +13,12 @@ any other Unix platform, but there are a number of additional features such as the integrated development environment (IDE) and the Package Manager that are worth pointing out. + .. _getting-osx: +.. _getting-and-installing-macpython: -Getting and Installing MacPython -================================ +Getting and Installing Python +============================= macOS used to come with Python 2.7 pre-installed between versions 10.8 and `12.3 `_. @@ -34,8 +36,8 @@ What you get after installing is a number of things: * A framework :file:`/Library/Frameworks/Python.framework`, which includes the Python executable and libraries. The installer adds this location to your shell - path. To uninstall MacPython, you can simply remove these three things. A - symlink to the Python executable is placed in /usr/local/bin/. + path. To uninstall Python, you can remove these three things. A + symlink to the Python executable is placed in :file:`/usr/local/bin/`. The Apple-provided build of Python is installed in :file:`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, @@ -107,7 +109,7 @@ Finder is non-standard as the Finder does not read your :file:`.profile` or :file:`~/.MacOSX/environment.plist`. See Apple's Technical Document QA1067 for details. -For more information on installation Python packages in MacPython, see section +For more information on installation Python packages, see section :ref:`mac-package-manager`. @@ -116,7 +118,7 @@ For more information on installation Python packages in MacPython, see section The IDE ======= -MacPython ships with the standard IDLE development environment. A good +Python ships with the standard IDLE development environment. A good introduction to using IDLE can be found at http://www.hashcollision.org/hkn/python/idle_intro/index.html. @@ -168,8 +170,8 @@ at https://pypi.org/project/py2app/. Other Resources =============== -The MacPython mailing list is an excellent support resource for Python users and -developers on the Mac: +The Pythonmac-SIG mailing list is an excellent support resource for Python users +and developers on the Mac: https://www.python.org/community/sigs/current/pythonmac-sig/ From 1b409db881063015a941f3cf4992a4da43108b68 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:36:59 +0200 Subject: [PATCH 05/11] Put macOS 10.8-12.3 info into note --- Doc/using/mac.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 0377da73bb6549e..f68c06b32912ea2 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -39,15 +39,17 @@ What you get after installing is a number of things: path. To uninstall Python, you can remove these three things. A symlink to the Python executable is placed in :file:`/usr/local/bin/`. -The Apple-provided build of Python is installed in -:file:`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, -respectively. You should never modify or delete these, as they are -Apple-controlled and are used by Apple- or third-party software. Remember that -if you choose to install a newer Python version from python.org, you will have -two different but functional Python installations on your computer, so it will -be important that your paths and usages are consistent with what you want to do. - -IDLE includes a help menu that allows you to access Python documentation. If you +.. note:: + + On macOS 10.8-12.3, the Apple-provided build of Python is installed in + :file:`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, + respectively. You should never modify or delete these, as they are + Apple-controlled and are used by Apple- or third-party software. Remember that + if you choose to install a newer Python version from python.org, you will have + two different but functional Python installations on your computer, so it will + be important that your paths and usages are consistent with what you want to do. + +IDLE includes a Help menu that allows you to access Python documentation. If you are completely new to Python you should start reading the tutorial introduction in that document. From 0ac92a7ebe695ca2e46185f13d3c370a36bdffa2 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:38:04 +0200 Subject: [PATCH 06/11] Use program role, spelling --- Doc/using/mac.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index f68c06b32912ea2..21ba2319779c80b 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -31,7 +31,7 @@ What you get after installing is a number of things: * A :file:`Python 3.12` folder in your :file:`Applications` folder. In here you find IDLE, the development environment that is a standard part of official - Python distributions; and PythonLauncher, which handles double-clicking Python + Python distributions; and :program:`Python Launcher`, which handles double-clicking Python scripts from the Finder. * A framework :file:`/Library/Frameworks/Python.framework`, which includes the @@ -61,7 +61,7 @@ How to run a Python script -------------------------- Your best way to get started with Python on macOS is through the IDLE -integrated development environment, see section :ref:`ide` and use the Help menu +integrated development environment; see section :ref:`ide` and use the Help menu when the IDE is running. If you want to run Python scripts from the Terminal window command line or from @@ -79,11 +79,11 @@ To run your script from the Terminal window you must make sure that To run your script from the Finder you have two options: -* Drag it to :program:`PythonLauncher` +* Drag it to :program:`Python Launcher`. -* Select :program:`PythonLauncher` as the default application to open your - script (or any .py script) through the finder Info window and double-click it. - :program:`PythonLauncher` has various preferences to control how your script is +* Select :program:`Python Launcher` as the default application to open your + script (or any ``.py`` script) through the finder Info window and double-click it. + :program:`Python Launcher` has various preferences to control how your script is launched. Option-dragging allows you to change these for one invocation, or use its Preferences menu to change things globally. @@ -165,8 +165,8 @@ Distributing Python Applications ================================ The standard tool for deploying standalone Python applications on the Mac is -:program:`py2app`. More information on installing and using py2app can be found -at https://pypi.org/project/py2app/. +:program:`py2app`. More information on installing and using :program:`py2app` +can be found at https://pypi.org/project/py2app/. Other Resources From 073261c55e01c681f2f23722ef83ce69180d856e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:38:34 +0200 Subject: [PATCH 07/11] Update editor names and links --- Doc/using/mac.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 21ba2319779c80b..12bc9ac3f9d22ec 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -66,13 +66,13 @@ when the IDE is running. If you want to run Python scripts from the Terminal window command line or from the Finder you first need an editor to create your script. macOS comes with a -number of standard Unix command line editors, :program:`vim` and -:program:`emacs` among them. If you want a more Mac-like editor, -:program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see -http://www.barebones.com/products/bbedit/index.html) are good choices, as is -:program:`TextMate` (see https://macromates.com/). Other editors include -:program:`Gvim` (https://macvim.org/macvim/) and :program:`Aquamacs` -(http://aquamacs.org/). +number of standard Unix command line editors, :program:`vim` +:program:`nano` among them. If you want a more Mac-like editor, +:program:`BBEdit` from Bare Bones Software (see +https://www.barebones.com/products/bbedit/index.html) are good choices, as is +:program:`TextMate` (see https://macromates.com). Other editors include +:program:`MacVim` (https://macvim.org) and :program:`Aquamacs` +(https://aquamacs.org). To run your script from the Terminal window you must make sure that :file:`/usr/local/bin` is in your shell search path. From 648712d508a2aacd5a9d32b994097cc083046dc0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 4 Feb 2024 23:39:42 +0200 Subject: [PATCH 08/11] Link to QA, include PySide --- Doc/using/mac.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 12bc9ac3f9d22ec..30c7cc3bd5707a0 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -108,8 +108,9 @@ Python on macOS honors all standard Unix environment variables such as :envvar:`PYTHONPATH`, but setting these variables for programs started from the Finder is non-standard as the Finder does not read your :file:`.profile` or :file:`.cshrc` at startup. You need to create a file -:file:`~/.MacOSX/environment.plist`. See Apple's Technical Document QA1067 for -details. +:file:`~/.MacOSX/environment.plist`. See Apple's +`Technical Q&A QA1067 `__ +for details. For more information on installation Python packages, see section :ref:`mac-package-manager`. @@ -122,7 +123,7 @@ The IDE Python ships with the standard IDLE development environment. A good introduction to using IDLE can be found at -http://www.hashcollision.org/hkn/python/idle_intro/index.html. +https://www.hashcollision.org/hkn/python/idle_intro/index.html. .. _mac-package-manager: @@ -158,6 +159,9 @@ macOS. Packages and documentation are available from https://www.wxpython.org. macOS. More information can be found at https://riverbankcomputing.com/software/pyqt/intro. +*PySide* is another cross-platform Qt-based toolkit. More information at +https://www.qt.io/qt-for-python. + .. _distributing-python-applications-on-the-mac: From 8e08403c2213c3b4a9bb48b3eb934d0a6212f9d9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:04:18 +0200 Subject: [PATCH 09/11] Update Python version number --- Doc/using/mac.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 30c7cc3bd5707a0..0229359a45b5b07 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -29,7 +29,7 @@ new Apple Silicon and legacy Intel processors, is available there. What you get after installing is a number of things: -* A :file:`Python 3.12` folder in your :file:`Applications` folder. In here +* A :file:`Python 3.13` folder in your :file:`Applications` folder. In here you find IDLE, the development environment that is a standard part of official Python distributions; and :program:`Python Launcher`, which handles double-clicking Python scripts from the Finder. From 773c2675c34d360f6bbad9c3f15830dd88208e8e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:38:55 +0200 Subject: [PATCH 10/11] Use substitution in rst_prolog to use version in code literal formatting --- Doc/conf.py | 4 ++++ Doc/using/mac.rst | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index c2d57696aeeaa37..df1c265bf57b420 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -64,6 +64,10 @@ import patchlevel version, release = patchlevel.get_version_info() +rst_prolog = f""" +.. |python_version_literal| replace:: ``Python {version}`` +""" + # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: today = '' diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst index 0229359a45b5b07..e99993238895f91 100644 --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -29,7 +29,7 @@ new Apple Silicon and legacy Intel processors, is available there. What you get after installing is a number of things: -* A :file:`Python 3.13` folder in your :file:`Applications` folder. In here +* A |python_version_literal| folder in your :file:`Applications` folder. In here you find IDLE, the development environment that is a standard part of official Python distributions; and :program:`Python Launcher`, which handles double-clicking Python scripts from the Finder. From 9211f7fab02b4f9f292384b5e9910b55d01ac620 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:59:24 +0200 Subject: [PATCH 11/11] Use substitution in rst_epilog to use version in code literal formatting --- Doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index df1c265bf57b420..b68d74d63782a6f 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -64,7 +64,7 @@ import patchlevel version, release = patchlevel.get_version_info() -rst_prolog = f""" +rst_epilog = f""" .. |python_version_literal| replace:: ``Python {version}`` """