Skip to content

Commit cd60bb7

Browse files
miss-islingtonhugovkencukou
authored
[3.15] gh-153872: macOS: free-threading support is installed by default on Python 3.15 (GH-154103) (#154479)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 5f3b228 commit cd60bb7

10 files changed

Lines changed: 31 additions & 27 deletions

Doc/using/mac.rst

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Installation steps
2929
For `current Python versions <https://www.python.org/downloads/>`_
3030
(other than those in ``security`` status), the release team produces a
3131
**Python for macOS** installer package for each new release.
32-
A list of available installers
33-
is available `here <https://www.python.org/downloads/macos/>`_.
32+
A list of available installers is provided on the
33+
`macOS downloads page <https://www.python.org/downloads/macos/>`__.
3434
We recommend using the most recent supported Python version where possible.
3535
Current installers provide a
3636
`universal2 binary <https://en.wikipedia.org/wiki/Universal_binary>`_ build
@@ -39,14 +39,14 @@ supported by a wide range of macOS versions,
3939
currently typically from at least **macOS 10.15 Catalina** on.
4040

4141
The downloaded file is a standard macOS installer package file (``.pkg``).
42-
File integrity information (checksum, size, sigstore signature, etc) for each file is included
42+
File integrity information (such as checksum, size, and Sigstore signature) for each file is included
4343
on the release download page. Installer packages and their contents are signed and notarized
4444
with ``Python Software Foundation`` Apple Developer ID certificates
4545
to meet `macOS Gatekeeper requirements <https://support.apple.com/en-us/102445>`_.
4646

4747
For a default installation, double-click on the downloaded installer package file.
4848
This should launch the standard macOS Installer app and display the first of several
49-
installer windows steps.
49+
installer steps.
5050

5151
.. image:: mac_installer_01_introduction.png
5252

@@ -73,8 +73,8 @@ display. For most uses, the standard set of installation operations is appropria
7373
By pressing the **Customize** button, you can choose to omit or select certain package
7474
components of the installer. Click on each package name to see a description of
7575
what it installs.
76-
To also install support for the optional free-threaded feature,
77-
see :ref:`install-freethreaded-macos`.
76+
For details of the optional free-threaded feature, which is installed
77+
by default, see :ref:`install-freethreaded-macos`.
7878

7979
.. image:: mac_installer_05_custom_install.png
8080

@@ -98,7 +98,7 @@ for its use.
9898

9999
.. image:: mac_installer_08_install_certificates.png
100100

101-
If ``Successfully installed certifi`` and ``update complete`` appears
101+
If ``Successfully installed certifi`` and ``update complete`` appear
102102
in the terminal window, the installation is complete.
103103
Close this terminal window and the installer window.
104104

@@ -171,7 +171,7 @@ be certain of what you are about to run.
171171

172172
.. _alternative_bundles:
173173

174-
Alternative Distributions
174+
Alternative distributions
175175
=========================
176176

177177
Besides the standard ``python.org`` for macOS installer, there are third-party
@@ -199,7 +199,7 @@ other libraries, and are not maintained or supported by the core Python team.
199199

200200
.. _mac-package-manager:
201201

202-
Installing Additional Python Packages
202+
Installing additional Python packages
203203
=====================================
204204

205205
Refer to the `Python Packaging User Guide`_ for more information.
@@ -211,7 +211,7 @@ Refer to the `Python Packaging User Guide`_ for more information.
211211

212212
.. _gui-programming-on-the-mac:
213213

214-
GUI Programming
214+
GUI programming
215215
===============
216216

217217
There are several options for building GUI applications on the Mac with Python.
@@ -241,19 +241,22 @@ A number of alternative macOS GUI toolkits are available including:
241241
supports desktop operating systems.
242242

243243

244-
Advanced Topics
244+
Advanced topics
245245
===============
246246

247247
.. _install-freethreaded-macos:
248248

249-
Installing Free-threaded Binaries
249+
Installing free-threaded binaries
250250
---------------------------------
251251

252252
.. versionadded:: 3.13
253253

254+
.. versionchanged:: 3.15
255+
Free-threading support is now installed by default.
256+
254257
The ``python.org`` :ref:`Python for macOS <getting-and-installing-macpython>`
255-
installer package can optionally install an additional build of
256-
Python |version| that supports :pep:`703`, the free-threading feature
258+
installer package installs, by default, an additional build of
259+
Python |version| that supports :term:`free threading`
257260
(running with the :term:`global interpreter lock` disabled).
258261
Check the release page on ``python.org`` for possible updated information.
259262

@@ -262,14 +265,15 @@ there is some additional overhead in single-threaded workloads compared
262265
to the regular build. Additionally, third-party packages, in particular ones
263266
with an :term:`extension module`, may not be ready for use in a
264267
free-threaded build, and will re-enable the :term:`GIL`.
265-
Therefore, the support for free-threading
266-
is not installed by default. It is packaged as a separate install option,
267-
available by clicking the **Customize** button on the **Installation Type**
268+
As of Python 3.15, free-threading support is installed by default.
269+
It is packaged as a separate install option, which can be deselected
270+
by clicking the **Customize** button on the **Installation Type**
268271
step of the installer as described above.
269272

270273
.. image:: mac_installer_09_custom_install_free_threaded.png
271274

272-
If the box next to the **Free-threaded Python** package name is checked,
275+
If the box next to the **Free-threaded Python** package name is checked
276+
(as it is by default),
273277
a separate :file:`PythonT.framework` will also be installed
274278
alongside the normal :file:`Python.framework` in :file:`/Library/Frameworks`.
275279
This configuration allows a free-threaded Python |version| build to co-exist
@@ -284,7 +288,7 @@ Known cautions and limitations:
284288
the free-threaded interpreter, and |python_x_dot_y_t_literal_config|,
285289
a configuration utility which may be useful for package builders.
286290
Since :file:`/usr/local/bin` is typically included in your shell ``PATH``,
287-
in most cases no changes to your ``PATH`` environment variables should
291+
in most cases no changes to your ``PATH`` environment variable should
288292
be needed to use |python_x_dot_y_t_literal|.
289293

290294
- For this release, the **Shell profile updater** package and the
@@ -367,8 +371,8 @@ the macOS command line :command:`installer` utility lets you select non-default
367371
options, too. If you are not familiar with :command:`installer`, it can be
368372
somewhat cryptic (see :command:`man installer` for more information).
369373
As an example, the following shell snippet shows one way to do it,
370-
using the |x_dot_y_b2_literal| release and selecting the free-threaded interpreter
371-
option:
374+
using the |x_dot_y_b2_literal| release and deselecting the free-threaded
375+
interpreter option:
372376

373377
.. parsed-literal::
374378
@@ -378,7 +382,7 @@ option:
378382
curl -O \https://www.python.org/ftp/python/\ |version|\ .0/${RELEASE}
379383
380384
# create installer choicechanges to customize the install:
381-
# enable the PythonTFramework-\ |version|\ package
385+
# disable the PythonTFramework-\ |version|\ package
382386
# while accepting the other defaults (install all other packages)
383387
cat > ./choicechanges.plist <<EOF
384388
<?xml version="1.0" encoding="UTF-8"?>
@@ -387,7 +391,7 @@ option:
387391
<array>
388392
<dict>
389393
<key>attributeSetting</key>
390-
<integer>1</integer>
394+
<integer>0</integer>
391395
<key>choiceAttribute</key>
392396
<string>selected</string>
393397
<key>choiceIdentifier</key>
@@ -400,7 +404,7 @@ option:
400404
sudo installer -pkg ./${RELEASE} -applyChoiceChangesXML ./choicechanges.plist -target /
401405
402406
403-
You can then test that both installer builds are now available with something like:
407+
After a default install, you can test that both builds are available with something like:
404408

405409
.. parsed-literal::
406410
@@ -425,7 +429,7 @@ You can then test that both installer builds are now available with something li
425429

426430
.. _distributing-python-applications-on-the-mac:
427431

428-
Distributing Python Applications
432+
Distributing Python applications
429433
--------------------------------
430434

431435
A range of tools exist for converting your Python code into a standalone
@@ -442,7 +446,7 @@ distributable application:
442446
* `PyInstaller <https://pyinstaller.org/>`_: A cross-platform packaging tool that creates
443447
a single file or folder as a distributable artifact.
444448

445-
App Store Compliance
449+
App Store compliance
446450
--------------------
447451

448452
Apps submitted for distribution through the macOS App Store must pass Apple's
@@ -464,7 +468,7 @@ This patch is not normally required to use CPython on a Mac; nor is it required
464468
if you are distributing an app *outside* the macOS App Store. It is *only*
465469
required if you are using the macOS App Store as a distribution channel.
466470

467-
Other Resources
471+
Other resources
468472
===============
469473

470474
The `python.org Help page <https://www.python.org/about/help/>`_ has links to many useful resources.
-32.8 KB
Loading
7.81 KB
Loading
20.4 KB
Loading
-5.14 KB
Loading
135 Bytes
Loading
-2.64 KB
Loading
-13.3 KB
Loading
-4.74 KB
Loading
-5 KB
Loading

0 commit comments

Comments
 (0)