Skip to content

Commit 8b96937

Browse files
authored
Merge branch 'main' into getaddrinfo-docs
2 parents a13ce47 + 748c4b4 commit 8b96937

File tree

1,610 files changed

+61553
-23439
lines changed

Some content is hidden

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

1,610 files changed

+61553
-23439
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"image": "ghcr.io/python/wasicontainer:latest",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
// For umask fix below.
9+
"/usr/bin/setfacl"
10+
],
11+
"updateContentCommand": {
12+
// Using the shell for `nproc` usage.
13+
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
14+
},
15+
"postCreateCommand": {
16+
// https://github.com/orgs/community/discussions/26026
17+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
18+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
// Highlighting for Parser/Python.asdl.
24+
"brettcannon.zephyr-asdl",
25+
// Highlighting for configure.ac.
26+
"maelvalais.autoconf",
27+
// C auto-complete.
28+
"ms-vscode.cpptools",
29+
// Python auto-complete.
30+
"ms-python.python"
31+
],
32+
"settings": {
33+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
34+
"C_Cpp.default.cStandard": "c11",
35+
"C_Cpp.default.defines": [
36+
"CONFIG_64",
37+
"Py_BUILD_CORE"
38+
],
39+
"C_Cpp.default.includePath": [
40+
"${workspaceFolder}/*",
41+
"${workspaceFolder}/Include/**"
42+
],
43+
// https://github.com/microsoft/vscode-cpptools/issues/10732
44+
"C_Cpp.errorSquiggles": "disabled",
45+
"editor.insertSpaces": true,
46+
"editor.rulers": [
47+
80
48+
],
49+
"editor.tabSize": 4,
50+
"editor.trimAutoWhitespace": true,
51+
"files.associations": {
52+
"*.h": "c"
53+
},
54+
"files.encoding": "utf8",
55+
"files.eol": "\n",
56+
"files.insertFinalNewline": true,
57+
"files.trimTrailingWhitespace": true,
58+
"python.analysis.diagnosticSeverityOverrides": {
59+
// Complains about shadowing the stdlib w/ the stdlib.
60+
"reportShadowedImports": "none",
61+
// Doesn't like _frozen_importlib.
62+
"reportMissingImports": "none"
63+
},
64+
"python.analysis.extraPaths": [
65+
"Lib"
66+
],
67+
"[restructuredtext]": {
68+
"editor.tabSize": 3
69+
}
70+
}
71+
}
72+
}
73+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Include/opcode_ids.h generated
8383
Include/token.h generated
8484
Lib/_opcode_metadata.py generated
8585
Lib/keyword.py generated
86+
Lib/idlelib/help.html generated
8687
Lib/test/certdata/*.pem generated
8788
Lib/test/certdata/*.0 generated
8889
Lib/test/levenshtein_examples.json generated

.github/CONTRIBUTING.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ Please be aware that our workflow does deviate slightly from the typical GitHub
2828
project. Details on how to properly submit a pull request are covered in
2929
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
3030
We utilize various bots and status checks to help with this, so do follow the
31-
comments they leave and their "Details" links, respectively. The key points of
32-
our workflow that are not covered by a bot or status check are:
31+
comments they leave and their "Details" links, respectively.
3332

34-
- All discussions that are not directly related to the code in the pull request
35-
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
36-
- Upon your first non-trivial pull request (which includes documentation changes),
37-
feel free to add yourself to ``Misc/ACKS``.
33+
The final key part of our workflow is that all discussions that are not
34+
directly related to the code in the pull request should happen on
35+
`GitHub Issues <https://github.com/python/cpython/issues>`__, generally in the
36+
pull request's parent issue.
3837

3938

4039
Setting Expectations

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
cooldown:
16+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
17+
# Cooldowns protect against supply chain attacks by avoiding the
18+
# highest-risk window immediately after new releases.
19+
default-days: 14
1520
- package-ecosystem: "pip"
1621
directory: "/Tools/"
1722
schedule:
1823
interval: "monthly"
1924
labels:
2025
- "skip issue"
2126
- "skip news"
27+
cooldown:
28+
default-days: 14

.github/workflows/build.yml

Lines changed: 28 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,10 @@ jobs:
109109
python-version: '3.x'
110110
- name: Runner image version
111111
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
112-
- name: Restore config.cache
113-
uses: actions/cache@v4
114-
with:
115-
path: config.cache
116-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
117-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
118112
- name: Install dependencies
119113
run: sudo ./.github/workflows/posix-deps-apt.sh
120114
- name: Add ccache to PATH
121115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
122-
- name: Configure ccache action
123-
uses: hendrikmuhs/ccache-action@v1.2
124-
with:
125-
save: false
126116
- name: Configure CPython
127117
run: |
128118
# Build Python with the libpython dynamic library
@@ -202,28 +192,19 @@ jobs:
202192
strategy:
203193
fail-fast: false
204194
matrix:
205-
# Cirrus and macos-14 are M1, macos-15-intel is default GHA Intel.
206-
# macOS 13 only runs tests against the GIL-enabled CPython.
207-
# Cirrus used for upstream, macos-14 for forks.
195+
# macos-14 is M1, macos-15-intel is Intel.
196+
# macos-15-intel only runs tests against the GIL-enabled CPython.
208197
os:
209-
- ghcr.io/cirruslabs/macos-runner:sonoma
210198
- macos-14
211199
- macos-15-intel
212-
is-fork: # only used for the exclusion trick
213-
- ${{ github.repository_owner != 'python' }}
214200
free-threading:
215201
- false
216202
- true
217203
exclude:
218-
- os: ghcr.io/cirruslabs/macos-runner:sonoma
219-
is-fork: true
220-
- os: macos-14
221-
is-fork: false
222204
- os: macos-15-intel
223205
free-threading: true
224206
uses: ./.github/workflows/reusable-macos.yml
225207
with:
226-
config_hash: ${{ needs.build-context.outputs.config-hash }}
227208
free-threading: ${{ matrix.free-threading }}
228209
os: ${{ matrix.os }}
229210

@@ -255,7 +236,6 @@ jobs:
255236
bolt: true
256237
uses: ./.github/workflows/reusable-ubuntu.yml
257238
with:
258-
config_hash: ${{ needs.build-context.outputs.config-hash }}
259239
bolt-optimizations: ${{ matrix.bolt }}
260240
free-threading: ${{ matrix.free-threading }}
261241
os: ${{ matrix.os }}
@@ -286,11 +266,6 @@ jobs:
286266
persist-credentials: false
287267
- name: Runner image version
288268
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
289-
- name: Restore config.cache
290-
uses: actions/cache@v4
291-
with:
292-
path: config.cache
293-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
294269
- name: Register gcc problem matcher
295270
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
296271
- name: Install dependencies
@@ -312,10 +287,6 @@ jobs:
312287
- name: Add ccache to PATH
313288
run: |
314289
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
315-
- name: Configure ccache action
316-
uses: hendrikmuhs/ccache-action@v1.2
317-
with:
318-
save: false
319290
- name: Configure CPython
320291
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
321292
- name: Build CPython
@@ -347,11 +318,6 @@ jobs:
347318
persist-credentials: false
348319
- name: Runner image version
349320
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
350-
- name: Restore config.cache
351-
uses: actions/cache@v4
352-
with:
353-
path: config.cache
354-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
355321
- name: Register gcc problem matcher
356322
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
357323
- name: Install dependencies
@@ -378,10 +344,6 @@ jobs:
378344
- name: Add ccache to PATH
379345
run: |
380346
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
381-
- name: Configure ccache action
382-
uses: hendrikmuhs/ccache-action@v1.2
383-
with:
384-
save: false
385347
- name: Configure CPython
386348
run: |
387349
./configure CFLAGS="-fdiagnostics-format=json" \
@@ -409,9 +371,8 @@ jobs:
409371
fail-fast: false
410372
matrix:
411373
include:
412-
# Use the same runs-on configuration as build-macos and build-ubuntu.
413374
- arch: aarch64
414-
runs-on: ${{ github.repository_owner == 'python' && 'ghcr.io/cirruslabs/macos-runner:sonoma' || 'macos-14' }}
375+
runs-on: macos-14
415376
- arch: x86_64
416377
runs-on: ubuntu-24.04
417378

@@ -423,13 +384,34 @@ jobs:
423384
- name: Build and test
424385
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
425386

387+
build-ios:
388+
name: iOS
389+
needs: build-context
390+
if: needs.build-context.outputs.run-tests == 'true'
391+
timeout-minutes: 60
392+
runs-on: macos-15
393+
steps:
394+
- uses: actions/checkout@v4
395+
with:
396+
persist-credentials: false
397+
398+
# GitHub recommends explicitly selecting the desired Xcode version:
399+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
400+
# This became a necessity as a result of
401+
# https://github.com/actions/runner-images/issues/12541 and
402+
# https://github.com/actions/runner-images/issues/12751.
403+
- name: Select Xcode version
404+
run: |
405+
sudo xcode-select --switch /Applications/Xcode_16.4.app
406+
407+
- name: Build and test
408+
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
409+
426410
build-wasi:
427411
name: 'WASI'
428412
needs: build-context
429413
if: needs.build-context.outputs.run-tests == 'true'
430414
uses: ./.github/workflows/reusable-wasi.yml
431-
with:
432-
config_hash: ${{ needs.build-context.outputs.config-hash }}
433415

434416
test-hypothesis:
435417
name: "Hypothesis tests on Ubuntu"
@@ -465,10 +447,6 @@ jobs:
465447
- name: Add ccache to PATH
466448
run: |
467449
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
468-
- name: Configure ccache action
469-
uses: hendrikmuhs/ccache-action@v1.2
470-
with:
471-
save: false
472450
- name: Setup directory envs for out-of-tree builds
473451
run: |
474452
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -479,11 +457,6 @@ jobs:
479457
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
480458
- name: Runner image version
481459
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
482-
- name: Restore config.cache
483-
uses: actions/cache@v4
484-
with:
485-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
486-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
487460
- name: Configure CPython out-of-tree
488461
working-directory: ${{ env.CPYTHON_BUILDDIR }}
489462
run: |
@@ -567,11 +540,6 @@ jobs:
567540
persist-credentials: false
568541
- name: Runner image version
569542
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
570-
- name: Restore config.cache
571-
uses: actions/cache@v4
572-
with:
573-
path: config.cache
574-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
575543
- name: Register gcc problem matcher
576544
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
577545
- name: Install dependencies
@@ -597,11 +565,6 @@ jobs:
597565
- name: Add ccache to PATH
598566
run: |
599567
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
600-
- name: Configure ccache action
601-
uses: hendrikmuhs/ccache-action@v1.2
602-
with:
603-
save: ${{ github.event_name == 'push' }}
604-
max-size: "200M"
605568
- name: Configure CPython
606569
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
607570
- name: Build CPython
@@ -633,7 +596,6 @@ jobs:
633596
uses: ./.github/workflows/reusable-san.yml
634597
with:
635598
sanitizer: ${{ matrix.sanitizer }}
636-
config_hash: ${{ needs.build-context.outputs.config-hash }}
637599
free-threading: ${{ matrix.free-threading }}
638600

639601
cross-build-linux:
@@ -648,11 +610,6 @@ jobs:
648610
persist-credentials: false
649611
- name: Runner image version
650612
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
651-
- name: Restore config.cache
652-
uses: actions/cache@v4
653-
with:
654-
path: config.cache
655-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
656613
- name: Register gcc problem matcher
657614
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
658615
- name: Set build dir
@@ -732,6 +689,7 @@ jobs:
732689
- build-ubuntu-ssltests-awslc
733690
- build-ubuntu-ssltests-openssl
734691
- build-android
692+
- build-ios
735693
- build-wasi
736694
- test-hypothesis
737695
- build-asan
@@ -768,6 +726,7 @@ jobs:
768726
build-ubuntu-ssltests-awslc,
769727
build-ubuntu-ssltests-openssl,
770728
build-android,
729+
build-ios,
771730
build-wasi,
772731
test-hypothesis,
773732
build-asan,

0 commit comments

Comments
 (0)