Skip to content

Commit 589317a

Browse files
authored
Merge branch 'main' into interpolation-doc-fix
2 parents 2061750 + 0b21682 commit 589317a

File tree

254 files changed

+10917
-6222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+10917
-6222
lines changed

.github/CODEOWNERS

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Modules/makesetup @erlend-aasland @AA-Turner @emmatyping
8686
Modules/Setup* @erlend-aasland @AA-Turner @emmatyping
8787
Tools/build/regen-configure.sh @AA-Turner
8888

89+
# generate-build-details
90+
Tools/build/generate-build-details.py @FFY00
91+
Lib/test/test_build_details.py @FFY00
92+
8993

9094
# ----------------------------------------------------------------------------
9195
# Documentation
@@ -241,10 +245,10 @@ Lib/test/test_getpath.py @FFY00
241245
Modules/getpath* @FFY00
242246

243247
# Hashing / ``hash()`` and related
244-
Include/cpython/pyhash.h @gpshead @picnixz @tiran
245-
Include/internal/pycore_pyhash.h @gpshead @picnixz @tiran
246-
Include/pyhash.h @gpshead @picnixz @tiran
247-
Python/pyhash.c @gpshead @picnixz @tiran
248+
Include/cpython/pyhash.h @gpshead @picnixz
249+
Include/internal/pycore_pyhash.h @gpshead @picnixz
250+
Include/pyhash.h @gpshead @picnixz
251+
Python/pyhash.c @gpshead @picnixz
248252

249253
# The import system (including importlib)
250254
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
@@ -371,14 +375,14 @@ Lib/calendar.py @AA-Turner
371375
Lib/test/test_calendar.py @AA-Turner
372376

373377
# Cryptographic Primitives and Applications
374-
**/*hashlib* @gpshead @picnixz @tiran
375-
**/*hashopenssl* @gpshead @picnixz @tiran
378+
**/*hashlib* @gpshead @picnixz
379+
**/*hashopenssl* @gpshead @picnixz
376380
**/*hmac* @gpshead @picnixz
377381
**/*ssl* @gpshead @picnixz
378382
Modules/_hacl/ @gpshead @picnixz
379-
Modules/*blake* @gpshead @picnixz @tiran
380-
Modules/*md5* @gpshead @picnixz @tiran
381-
Modules/*sha* @gpshead @picnixz @tiran
383+
Modules/*blake* @gpshead @picnixz
384+
Modules/*md5* @gpshead @picnixz
385+
Modules/*sha* @gpshead @picnixz
382386

383387
# Codecs
384388
Modules/cjkcodecs/ @corona10

.github/actionlint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
self-hosted-runner:
22
# Pending https://github.com/rhysd/actionlint/issues/533
3-
labels: ["windows-11-arm"]
3+
# and https://github.com/rhysd/actionlint/issues/571
4+
labels: ["windows-11-arm", "macos-15-intel"]
45

56
config-variables: null
67

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ jobs:
202202
strategy:
203203
fail-fast: false
204204
matrix:
205-
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
205+
# Cirrus and macos-14 are M1, macos-15-intel is default GHA Intel.
206206
# macOS 13 only runs tests against the GIL-enabled CPython.
207207
# Cirrus used for upstream, macos-14 for forks.
208208
os:
209209
- ghcr.io/cirruslabs/macos-runner:sonoma
210210
- macos-14
211-
- macos-13
211+
- macos-15-intel
212212
is-fork: # only used for the exclusion trick
213213
- ${{ github.repository_owner != 'python' }}
214214
free-threading:
@@ -219,7 +219,7 @@ jobs:
219219
is-fork: true
220220
- os: macos-14
221221
is-fork: false
222-
- os: macos-13
222+
- os: macos-15-intel
223223
free-threading: true
224224
uses: ./.github/workflows/reusable-macos.yml
225225
with:

.github/workflows/jit.yml

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
runner: windows-11-arm
8282
- target: x86_64-apple-darwin/clang
8383
architecture: x86_64
84-
runner: macos-13
84+
runner: macos-15-intel
8585
- target: aarch64-apple-darwin/clang
8686
architecture: aarch64
8787
runner: macos-14
@@ -106,15 +106,10 @@ jobs:
106106
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
107107
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
108108
109-
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
110-
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
111-
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
112-
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
113109
- name: macOS
114110
if: runner.os == 'macOS'
115111
run: |
116112
brew update
117-
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
118113
brew install llvm@${{ matrix.llvm }}
119114
export SDKROOT="$(xcrun --show-sdk-path)"
120115
# Set MACOSX_DEPLOYMENT_TARGET and -Werror=unguarded-availability to
@@ -134,6 +129,34 @@ jobs:
134129
make all --jobs 4
135130
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
136131
132+
jit-with-disabled-gil:
133+
name: Free-Threaded (Debug)
134+
needs: interpreter
135+
runs-on: ubuntu-24.04
136+
timeout-minutes: 90
137+
strategy:
138+
fail-fast: false
139+
matrix:
140+
llvm:
141+
- 19
142+
steps:
143+
- uses: actions/checkout@v4
144+
with:
145+
persist-credentials: false
146+
- uses: actions/setup-python@v5
147+
with:
148+
python-version: '3.11'
149+
- name: Build with JIT enabled and GIL disabled
150+
run: |
151+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
152+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
153+
./configure --enable-experimental-jit --with-pydebug --disable-gil
154+
make all --jobs 4
155+
- name: Run tests
156+
run: |
157+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
158+
continue-on-error: true
159+
137160
no-opt-jit:
138161
name: JIT without optimizations (Debug)
139162
needs: interpreter
@@ -160,31 +183,3 @@ jobs:
160183
- name: Run tests without optimizations
161184
run: |
162185
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163-
164-
# XXX: GH-133171
165-
# jit-with-disabled-gil:
166-
# name: Free-Threaded (Debug)
167-
# needs: interpreter
168-
# runs-on: ubuntu-24.04
169-
# timeout-minutes: 90
170-
# strategy:
171-
# fail-fast: false
172-
# matrix:
173-
# llvm:
174-
# - 19
175-
# steps:
176-
# - uses: actions/checkout@v4
177-
# with:
178-
# persist-credentials: false
179-
# - uses: actions/setup-python@v5
180-
# with:
181-
# python-version: '3.11'
182-
# - name: Build with JIT enabled and GIL disabled
183-
# run: |
184-
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
185-
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
186-
# ./configure --enable-experimental-jit --with-pydebug --disable-gil
187-
# make all --jobs 4
188-
# - name: Run tests
189-
# run: |
190-
# ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/project-updater.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ jobs:
6060
--prefix=/opt/python-dev \
6161
--with-openssl="$(brew --prefix [email protected])"
6262
- name: Build CPython
63-
if : ${{ inputs.free-threading || inputs.os != 'macos-13' }}
63+
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
6464
run: gmake -j8
6565
- name: Build CPython for compiler warning check
66-
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
66+
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
6767
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6868
- name: Display build info
6969
run: make pythoninfo
7070
- name: Check compiler warnings
71-
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
71+
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
7272
run: >-
7373
python3 Tools/build/check_warnings.py
7474
--compiler-output-file-path=compiler_output_macos.txt

.github/workflows/tail-call.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
# runner: windows-2022
5959
- target: x86_64-apple-darwin/clang
6060
architecture: x86_64
61-
runner: macos-13
61+
runner: macos-15-intel
6262
- target: aarch64-apple-darwin/clang
6363
architecture: aarch64
6464
runner: macos-14
@@ -101,17 +101,10 @@ jobs:
101101
set LLVMInstallDir=C:\Program Files\LLVM
102102
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
103103
104-
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
105-
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
106-
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
107-
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
108-
# Note: when a new LLVM is released, the homebrew installation directory changes, so the builds will fail.
109-
# We either need to upgrade LLVM or change the directory being pointed to.
110104
- name: Native macOS (release)
111105
if: runner.os == 'macOS'
112106
run: |
113107
brew update
114-
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
115108
brew install llvm@${{ matrix.llvm }}
116109
export SDKROOT="$(xcrun --show-sdk-path)"
117110
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"

.pre-commit-config.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.12.8
3+
rev: v0.13.2
44
hooks:
5-
- id: ruff
5+
- id: ruff-check
66
name: Run Ruff (lint) on Doc/
77
args: [--exit-non-zero-on-fix]
88
files: ^Doc/
9-
- id: ruff
9+
- id: ruff-check
1010
name: Run Ruff (lint) on Lib/test/
1111
args: [--exit-non-zero-on-fix]
1212
files: ^Lib/test/
13-
- id: ruff
13+
- id: ruff-check
1414
name: Run Ruff (lint) on Tools/build/
1515
args: [--exit-non-zero-on-fix, --config=Tools/build/.ruff.toml]
1616
files: ^Tools/build/
17-
- id: ruff
17+
- id: ruff-check
1818
name: Run Ruff (lint) on Tools/i18n/
1919
args: [--exit-non-zero-on-fix, --config=Tools/i18n/.ruff.toml]
2020
files: ^Tools/i18n/
21-
- id: ruff
21+
- id: ruff-check
2222
name: Run Ruff (lint) on Argument Clinic
2323
args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml]
2424
files: ^Tools/clinic/|Lib/test/test_clinic.py
25-
- id: ruff
25+
- id: ruff-check
2626
name: Run Ruff (lint) on Tools/peg_generator/
2727
args: [--exit-non-zero-on-fix, --config=Tools/peg_generator/.ruff.toml]
2828
files: ^Tools/peg_generator/
@@ -36,7 +36,7 @@ repos:
3636
files: ^Tools/build/check_warnings.py
3737

3838
- repo: https://github.com/psf/black-pre-commit-mirror
39-
rev: 25.1.0
39+
rev: 25.9.0
4040
hooks:
4141
- id: black
4242
name: Run Black on Tools/jit/
@@ -47,7 +47,6 @@ repos:
4747
hooks:
4848
- id: remove-tabs
4949
types: [python]
50-
exclude: ^Tools/c-analyzer/cpython/_parser.py
5150

5251
- repo: https://github.com/pre-commit/pre-commit-hooks
5352
rev: v6.0.0
@@ -68,7 +67,7 @@ repos:
6867
files: '^\.github/CODEOWNERS|\.(gram)$'
6968

7069
- repo: https://github.com/python-jsonschema/check-jsonschema
71-
rev: 0.33.2
70+
rev: 0.34.0
7271
hooks:
7372
- id: check-dependabot
7473
- id: check-github-workflows
@@ -80,7 +79,7 @@ repos:
8079
- id: actionlint
8180

8281
- repo: https://github.com/woodruffw/zizmor-pre-commit
83-
rev: v1.11.0
82+
rev: v1.14.1
8483
hooks:
8584
- id: zizmor
8685

Apple/__main__.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def unpack_deps(
316316
for name_ver in [
317317
"BZip2-1.0.8-2",
318318
"libFFI-3.4.7-2",
319-
"OpenSSL-3.0.16-2",
319+
"OpenSSL-3.0.17-1",
320320
"XZ-5.6.4-2",
321321
"mpdecimal-4.0.0-2",
322322
"zstd-1.5.7-1",
@@ -577,6 +577,7 @@ def create_xcframework(platform: str) -> str:
577577

578578
# Extract the package version from the merged framework
579579
version = package_version(package_path / "Python.xcframework")
580+
version_tag = ".".join(version.split(".")[:2])
580581

581582
# On non-macOS platforms, each framework in XCframework only contains the
582583
# headers, libPython, plus an Info.plist. Other resources like the standard
@@ -647,6 +648,23 @@ def create_xcframework(platform: str) -> str:
647648
slice_framework / f"Headers/pyconfig-{arch}.h",
648649
)
649650

651+
# Apple identifies certain libraries as "security risks"; if you
652+
# statically link those libraries into a Framework, you become
653+
# responsible for providing a privacy manifest for that framework.
654+
xcprivacy_file = {
655+
"OpenSSL": subdir(host_triple) / "prefix/share/OpenSSL.xcprivacy"
656+
}
657+
print(f" - {multiarch} xcprivacy files")
658+
for module, lib in [
659+
("_hashlib", "OpenSSL"),
660+
("_ssl", "OpenSSL"),
661+
]:
662+
shutil.copy(
663+
xcprivacy_file[lib],
664+
slice_path
665+
/ f"lib-{arch}/python{version_tag}/lib-dynload/{module}.xcprivacy",
666+
)
667+
650668
print(" - build tools")
651669
shutil.copytree(
652670
PYTHON_DIR / "Apple/testbed/Python.xcframework/build",

Apple/testbed/Python.xcframework/build/utils.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ install_dylib () {
6767

6868
# The name of the extension file
6969
EXT=$(basename "$FULL_EXT")
70+
# The name and location of the module
71+
MODULE_PATH=$(dirname "$FULL_EXT")
72+
MODULE_NAME=$(echo $EXT | cut -d "." -f 1)
7073
# The location of the extension file, relative to the bundle
7174
RELATIVE_EXT=${FULL_EXT#$CODESIGNING_FOLDER_PATH/}
7275
# The path to the extension file, relative to the install base
@@ -94,6 +97,16 @@ install_dylib () {
9497
# Create a back reference to the .so file location in the framework
9598
echo "${RELATIVE_EXT%.so}.fwork" > "$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/$FULL_MODULE_NAME.origin"
9699

100+
# If the framework provides an xcprivacy file, install it.
101+
if [ -e "$MODULE_PATH/$MODULE_NAME.xcprivacy" ]; then
102+
echo "Installing XCPrivacy file for $FRAMEWORK_FOLDER/$FULL_MODULE_NAME"
103+
XCPRIVACY_FILE="$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/PrivacyInfo.xcprivacy"
104+
if [ -e "$XCPRIVACY_FILE" ]; then
105+
rm -rf "$XCPRIVACY_FILE"
106+
fi
107+
mv "$MODULE_PATH/$MODULE_NAME.xcprivacy" "$XCPRIVACY_FILE"
108+
fi
109+
97110
echo "Signing framework as $EXPANDED_CODE_SIGN_IDENTITY_NAME ($EXPANDED_CODE_SIGN_IDENTITY)..."
98111
/usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" ${OTHER_CODE_SIGN_FLAGS:-} -o runtime --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der "$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER"
99112
}

0 commit comments

Comments
 (0)