Skip to content

Commit

Permalink
Add support for macOS 11.0 as a target.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Oct 21, 2024
1 parent bc85a08 commit a86f663
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@ shell scripts listed above are available for your build and test.
Build options are controlled mainly by the following environment
variables:

* ``MB_PYTHON_VER`` sets the Python version targeted: ``major.minor.patch``
* ``MB_PYTHON_VERSION`` sets the Python version targeted: ``major.minor.patch``
for CPython, or ``pypy-major.minor`` for PyPy.
* ``MB_PYTHON_OSX_VER`` sets the minimum macOS SDK version for any C
extensions. For CPython targets it may be set to 10.6 or 10.9, provided a
* ``MB_PYTHON_OSX_VER`` sets the minimum macOS SDK version for any C extensions.
For CPython targets it may be set to 10.6, 10.9 or 11.0, provided a
corresponding Python build is available at `python.org
<https://www.python.org/downloads/mac-osx/>`_. It defaults to the highest
version available. It's ignored for PyPy targets.
* ``PLAT`` sets the architectures built for any C extensions: ``x86_64`` or
``intel`` for 64-bit or 64/32-bit respectively. It defaults to the same
arches as the target Python version: 64-bit for CPython macOS 10.9 or PyPy,
and 64/32-bit for CPython 10.6.
``intel`` for 64-bit or 64/32-bit respectively. It defaults to the same arches
as the target Python version: arm64 for macOS 11.0; x86_64 for CPython
macOS 10.9 or PyPy; and 64/32-bit for CPython 10.6.

In most cases it's best to rely on the defaults for ``MB_PYTHON_OSX_VER`` and
``PLAT``, rather than setting them explicitly. Examples of exceptions to this
Expand Down
6 changes: 4 additions & 2 deletions osx_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function get_macpython_osx_ver {
}

function macpython_arch_for_version {
# echo arch (intel or x86_64) that a version of Python is expected
# echo arch (intel, x86_64 or arm64) that a version of Python is expected
# to be built for
# Parameters
# $py_ver Python version, in the format (major.minor.patch) for
Expand All @@ -238,8 +238,10 @@ function macpython_arch_for_version {
echo "intel"
elif [[ "$py_osx_ver" == "10.9" ]]; then
echo "x86_64"
elif [[ "$py_osx_ver" == "11.0" ]]; then
echo "arm64"
else
echo "Unexpected CPython macOS version: ${py_osx_ver}, supported values: 10.6 and 10.9"
echo "Unexpected CPython macOS version: ${py_osx_ver}, supported values: 10.6, 10.9, 11.0"
exit 1
fi
else
Expand Down
1 change: 1 addition & 0 deletions tests/test_osx_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
[ "$(macpython_arch_for_version 2.7 10.6)" == "intel" ] || ingest
[ "$(macpython_arch_for_version 2.7 10.9)" == "x86_64" ] || ingest
[ "$(macpython_arch_for_version pypy-2.7)" == "x86_64" ] || ingest
[ "$(macpython_arch_for_version 3.10 11.0)" == "arm64" ] || ingest

# test lookup of arch / min macOS versions from installed Python distutils tag
[ "$(get_macpython_arch macosx-10.6-intel)" == "intel" ] || ingest
Expand Down

0 comments on commit a86f663

Please sign in to comment.