8000 Merge remote-tracking branch 'upstream/main' into gh-105223-apple-rea… · corona10/cpython@501f1a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 501f1a4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pythongh-105223-apple-readline
2 parents dfcbae0 + 3cce6be commit 501f1a4

File tree

268 files changed

+23320
-19894
lines changed

Some content is hidden

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

268 files changed

+23320
-19894
lines changed

.azure-pipelines/ci.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
trigger: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
1+
trigger: ['main', '3.12', '3.11', '3.10', '3.9', '3.8', '3.7']
22

33
jobs:
44
- job: Prebuild
@@ -11,25 +11,6 @@ jobs:
1111
- template: ./prebuild-checks.yml
1212

1313

14-
- job: Ubuntu_CI_Tests
15-
displayName: Ubuntu CI Tests
16-
dependsOn: Prebuild
17-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
18-
19-
pool:
20-
vmImage: ubuntu-22.04
21-
22-
variables:
23-
testRunTitle: '$(build.sourceBranchName)-linux'
24-
testRunPlatform: linux
25-
openssl_version: 1.1.1u
26-
27-
steps:
28-
- template: ./posix-steps.yml
29-
parameters:
30-
dependencies: apt
31-
32-
3314
- job: Windows_CI_Tests
3415
displayName: Windows CI Tests
3516
dependsOn: Prebuild

.azure-pipelines/posix-steps.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
parameters:
2-
sudo_dependencies: sudo
3-
dependencies: apt
4-
patchcheck: true
5-
xvfb: true
6-
71
steps:
82
- checkout: self
93
clean: true
@@ -13,7 +7,7 @@ steps:
137
- script: sudo setfacl -Rb /home/vsts
148
displayName: 'Workaround ACL issue'
159

16-
- script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
10+
- script: sudo ./.azure-pipelines/posix-deps-apt.sh $(openssl_version)
1711
displayName: 'Install dependencies'
1812

1913
- script: ./configure --with-pydebug
@@ -25,27 +19,8 @@ steps:
2519
- script: make pythoninfo
2620
displayName: 'Display build info'
2721

28-
- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
29-
displayName: 'Tests'
30-
env:
31-
${{ if eq(parameters.xvfb, 'true') }}:
32-
COMMAND: xvfb-run make
33-
${{ if ne(parameters.xvfb, 'true') }}:
34-
COMMAND: make
35-
36-
- ${{ if eq(parameters.patchcheck, 'true') }}:
37-
- script: |
38-
git fetch origin
39-
./python Tools/patchcheck/patchcheck.py --ci true
40-
displayName: 'Run patchcheck.py'
41-
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
42-
43-
44-
- task: PublishTestResults@2
45-
displayName: 'Publish Test Results'
46-
inputs:
47-
testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
48-
mergeTestResults: true
49-
testRunTitle: $(testRunTitle)
50-
platform: $(testRunPlatform)
51-
condition: succeededOrFailed()
22+
- script: |
23+
git fetch origin
24+
./python Tools/patchcheck/patchcheck.py --ci true
25+
displayName: 'Run patchcheck.py'
26+
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

.azure-pipelines/pr.yml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pr: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
1+
pr: ['main', '3.12', '3.11', '3.10', '3.9', '3.8', '3.7']
22

33
jobs:
44
- job: Prebuild
@@ -11,8 +11,8 @@ jobs:
1111
- template: ./prebuild-checks.yml
1212

1313

14-
- job: Ubuntu_PR_Tests
15-
displayName: Ubuntu PR Tests
14+
- job: Ubuntu_Patchcheck
15+
displayName: Ubuntu patchcheck
1616
dependsOn: Prebuild
1717
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
1818

@@ -26,36 +26,3 @@ jobs:
2626

2727
steps:
2828
- template: ./posix-steps.yml
29-
parameters:
30-
dependencies: apt
31-
32-
33-
- job: Windows_PR_Tests
34-
displayName: Windows PR Tests
35-
dependsOn: Prebuild
36-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
37-
38-
pool:
39-
vmImage: windows-2022
40-
41-
strategy:
42-
matrix:
43-
win32:
44-
arch: win32
45-
buildOpt: '-p Win32'
46-
testRunTitle: '$(System.PullRequest.TargetBranch)-win32'
47-
testRunPlatform: win32
48-
win64:
49-
arch: amd64
50-
buildOpt: '-p x64'
51-
testRunTitle: '$(System.PullRequest.TargetBranch)-win64'
52-
testRunPlatform: win64
53-
winarm64:
54-
arch: arm64
55-
buildOpt: '-p arm64'
56-
maxParallel: 4
57-
58-
steps:
59-
- template: ./windows-steps.yml
60-
parameters:
61-
targetBranch: $(System.PullRequest.TargetBranch)

.cirrus.yml renamed to .cirrus-DISABLED.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# gh-91960: Job disabled since Python is out of free credit (September 2023):
2+
# https://discuss.python.org/t/freebsd-gets-a-new-cirrus-ci-github-action-job-and-a-new-buildbot/33122/26
3+
14
freebsd_task:
25
freebsd_instance:
36
matrix:

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
path: config.cache
119119
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
120120
- uses: actions/setup-python@v4
121+
with:
122+
python-version: '3.x'
121123
- name: Install Dependencies
122124
run: sudo ./.github/workflows/posix-deps-apt.sh
123125
- name: Add ccache to PATH
@@ -201,6 +203,21 @@ jobs:
201203
- name: Tests
202204
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
203205

206+
build_win_arm64:
207+
name: 'Windows (arm64)'
208+
runs-on: windows-latest
209+
timeout-minutes: 60
210+
needs: check_source
211+
if: needs.check_source.outputs.run_tests == 'true'
212+
env:
213+
IncludeUwp: 'true'
214+
steps:
215+
- uses: actions/checkout@v4
216+
- name: Register MSVC problem matcher
217+
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
218+
- name: Build CPython
219+
run: .\PCbuild\build.bat -e -d -p arm64
220+
204221
build_macos:
205222
name: 'macOS'
206223
runs-on: macos-latest
@@ -530,6 +547,7 @@ jobs:
530547
- check_generated_files
531548
- build_win32
532549
- build_win_amd64
550+
- build_win_arm64
533551
- build_macos
534552
- build_ubuntu
535553
- build_ubuntu_ssltests
@@ -546,6 +564,7 @@ jobs:
546564
build_macos,
547565
build_ubuntu_ssltests,
548566
build_win32,
567+
build_win_arm64,
549568
test_hypothesis,
550569
allowed-skips: >-
551570
${{
@@ -561,6 +580,7 @@ jobs:
561580
check_generated_files,
562581
build_win32,
563582
build_win_amd64,
583+
build_win_arm64,
564584
build_macos,
565585
build_ubuntu,
566586
build_ubuntu_ssltests,

.github/workflows/mypy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77
- main
88
pull_request:
99
paths:
10-
- "Tools/clinic/**"
10+
- ".github/workflows/mypy.yml"
1111
- "Tools/cases_generator/**"
12+
- "Tools/clinic/**"
1213
- "Tools/peg_generator/**"
1314
- "Tools/requirements-dev.txt"
14-
- ".github/workflows/mypy.yml"
15+
- "Tools/wasm/**"
1516
workflow_dispatch:
1617

1718
permissions:
@@ -34,6 +35,7 @@ jobs:
3435
"Tools/cases_generator",
3536
"Tools/clinic",
3637
"Tools/peg_generator",
38+
"Tools/wasm",
3739
]
3840
name: Run mypy on ${{ matrix.target }}
3941
runs-on: ubuntu-latest

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- name: 'Set up Python'
7575
uses: actions/setup-python@v4
7676
with:
77-
python-version: '3.11' # known to work with Sphinx 3.2
77+
python-version: '3.11' # known to work with Sphinx 4.2
7878
cache: 'pip'
7979
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
8080
- name: 'Install build dependencies'

Doc/c-api/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ Exception Objects
786786
787787
Implement part of the interpreter's implementation of :keyword:`!except*`.
788788
*orig* is the original exception that was caught, and *excs* is the list of
789-
the exceptions that need to be raised. This list contains the the unhandled
789+
the exceptions that need to be raised. This list contains the unhandled
790790
part of *orig*, if any, as well as the exceptions that were raised from the
791791
:keyword:`!except*` clauses (so they have a different traceback from *orig*) and
792792
those that were reraised (and have the same traceback as *orig*).

Doc/c-api/mapping.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
7676
rather than a :c:expr:`PyObject*`.
7777
7878
79+
.. c:function:: int PyMapping_HasKeyWithError(PyObject *o, PyObject *key)
80+
81+
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
82+
This is equivalent to the Python expression ``key in o``.
83+
On failure, return ``-1``.
84+
85+
.. versionadded:: 3.13
86+
87+
88+
.. c:function:: int PyMapping_HasKeyStringWithError(PyObject *o, const char *key)
89+
90+
This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is
91+
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
92+
rather than a :c:expr:`PyObject*`.
93+
94+
.. versionadded:: 3.13
95+
96+
7997
.. c:function:: int PyMapping_HasKey(PyObject *o, PyObject *key)
8098
8199
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
@@ -86,8 +104,8 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
86104
87105
Exceptions which occur when this calls :meth:`~object.__getitem__`
88106
method are silently ignored.
89-
For proper error handling, use :c:func:`PyMapping_GetOptionalItem` or
90-
:c:func:`PyObject_GetItem()` instead.
107+
For proper error handling, use :c:func:`PyMapping_HasKeyWithError`,
108+
:c:func:`PyMapping_GetOptionalItem` or :c:func:`PyObject_GetItem()` instead.
91109
92110
93111
.. c:function:: int PyMapping_HasKeyString(PyObject *o, const char *key)
@@ -101,7 +119,8 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
101119
Exceptions that occur when this calls :meth:`~object.__getitem__`
102120
method or while creating the temporary :class:`str`
103121
object are silently ignored.
104-
For proper error handling, use :c:func:`PyMapping_GetOptionalItemString` or
122+
For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`,
123+
:c:func:`PyMapping_GetOptionalItemString` or
105124
:c:func:`PyMapping_GetItemString` instead.
106125
107126

Doc/c-api/object.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ Object Protocol
2727
instead of the :func:`repr`.
2828
2929
30+
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, const char *attr_name)
31+
32+
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
33+
This is equivalent to the Python expression ``hasattr(o, attr_name)``.
34+
On failure, return ``-1``.
35+
36+
.. versionadded:: 3.13
37+
38+
39+
.. c:function:: int PyObject_HasAttrStringWithError(PyObject *o, const char *attr_name)
40+
41+
This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is
42+
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
43+
rather than a :c:expr:`PyObject*`.
44+
45+
.. versionadded:: 3.13
46+
47+
3048
.. c:function:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
3149
3250
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
@@ -37,8 +55,8 @@ Object Protocol
3755
3856
Exceptions that occur when this calls :meth:`~object.__getattr__` and
3957
:meth:`~object.__getattribute__` methods are silently ignored.
40-
For proper error handling, use :c:func:`PyObject_GetOptionalAttr` or
41-
:c:func:`PyObject_GetAttr` instead.
58+
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
59+
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.
4260
4361
4462
.. c:function:: int PyObject_HasAttrString(PyObject *o, const char *attr_name)
@@ -52,7 +70,8 @@ Object Protocol
5270
Exceptions that occur when this calls :meth:`~object.__getattr__` and
5371
:meth:`~object.__getattribute__` methods or while creating the temporary
5472
:class:`str` object are silently ignored.
55-
For proper error handling, use :c:func:`PyObject_GetOptionalAttrString`
73+
For proper error handling, use :c:func:`PyObject_HasAttrStringWithError`,
74+
:c:func:`PyObject_GetOptionalAttrString`
5675
or :c:func:`PyObject_GetAttrString` instead.
5776
5877

0 commit comments

Comments
 (0)
0