Skip to content

Commit

Permalink
Merge branch 'main' into pickle_copy
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt authored Sep 25, 2023
2 parents 7da7086 + d73c12b commit e54350f
Show file tree
Hide file tree
Showing 344 changed files with 24,986 additions and 21,516 deletions.
21 changes: 1 addition & 20 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
trigger: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
trigger: ['main', '3.12', '3.11', '3.10', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
Expand All @@ -11,25 +11,6 @@ jobs:
- template: ./prebuild-checks.yml


- job: Ubuntu_CI_Tests
displayName: Ubuntu CI Tests
dependsOn: Prebuild
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: ubuntu-22.04

variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1u

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt


- job: Windows_CI_Tests
displayName: Windows CI Tests
dependsOn: Prebuild
Expand Down
37 changes: 6 additions & 31 deletions .azure-pipelines/posix-steps.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
parameters:
sudo_dependencies: sudo
dependencies: apt
patchcheck: true
xvfb: true

steps:
- checkout: self
clean: true
Expand All @@ -13,7 +7,7 @@ steps:
- script: sudo setfacl -Rb /home/vsts
displayName: 'Workaround ACL issue'

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

- script: ./configure --with-pydebug
Expand All @@ -25,27 +19,8 @@ steps:
- script: make pythoninfo
displayName: 'Display build info'

- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
displayName: 'Tests'
env:
${{ if eq(parameters.xvfb, 'true') }}:
COMMAND: xvfb-run make
${{ if ne(parameters.xvfb, 'true') }}:
COMMAND: make

- ${{ if eq(parameters.patchcheck, 'true') }}:
- script: |
git fetch origin
./python Tools/patchcheck/patchcheck.py --ci true
displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
mergeTestResults: true
testRunTitle: $(testRunTitle)
platform: $(testRunPlatform)
condition: succeededOrFailed()
- script: |
git fetch origin
./python Tools/patchcheck/patchcheck.py --ci true
displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
39 changes: 3 additions & 36 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pr: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
pr: ['main', '3.12', '3.11', '3.10', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
Expand All @@ -11,8 +11,8 @@ jobs:
- template: ./prebuild-checks.yml


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

Expand All @@ -26,36 +26,3 @@ jobs:

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt


- job: Windows_PR_Tests
displayName: Windows PR Tests
dependsOn: Prebuild
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: windows-2022

strategy:
matrix:
win32:
arch: win32
buildOpt: '-p Win32'
testRunTitle: '$(System.PullRequest.TargetBranch)-win32'
testRunPlatform: win32
win64:
arch: amd64
buildOpt: '-p x64'
testRunTitle: '$(System.PullRequest.TargetBranch)-win64'
testRunPlatform: win64
winarm64:
arch: arm64
buildOpt: '-p arm64'
maxParallel: 4

steps:
- template: ./windows-steps.yml
parameters:
targetBranch: $(System.PullRequest.TargetBranch)
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ jobs:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Add ccache to PATH
Expand Down Expand Up @@ -201,6 +203,21 @@ jobs:
- name: Tests
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0

build_win_arm64:
name: 'Windows (arm64)'
runs-on: windows-latest
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
IncludeUwp: 'true'
steps:
- uses: actions/checkout@v4
- name: Register MSVC problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
run: .\PCbuild\build.bat -e -d -p arm64

build_macos:
name: 'macOS'
runs-on: macos-latest
Expand Down Expand Up @@ -530,6 +547,7 @@ jobs:
- check_generated_files
- build_win32
- build_win_amd64
- build_win_arm64
- build_macos
- build_ubuntu
- build_ubuntu_ssltests
Expand All @@ -546,6 +564,7 @@ jobs:
build_macos,
build_ubuntu_ssltests,
build_win32,
build_win_arm64,
test_hypothesis,
allowed-skips: >-
${{
Expand All @@ -561,6 +580,7 @@ jobs:
check_generated_files,
build_win32,
build_win_amd64,
build_win_arm64,
build_macos,
build_ubuntu,
build_ubuntu_ssltests,
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
- main
pull_request:
paths:
- "Tools/clinic/**"
- ".github/workflows/mypy.yml"
- "Tools/cases_generator/**"
- "Tools/clinic/**"
- "Tools/peg_generator/**"
- "Tools/requirements-dev.txt"
- ".github/workflows/mypy.yml"
- "Tools/wasm/**"
workflow_dispatch:

permissions:
Expand All @@ -34,6 +35,7 @@ jobs:
"Tools/cases_generator",
"Tools/clinic",
"Tools/peg_generator",
"Tools/wasm",
]
name: Run mypy on ${{ matrix.target }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: 'Set up Python'
uses: actions/setup-python@v4
with:
python-version: '3.11' # known to work with Sphinx 3.2
python-version: '3.11' # known to work with Sphinx 4.2
cache: 'pip'
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
- name: 'Install build dependencies'
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ Exception Objects
Implement part of the interpreter's implementation of :keyword:`!except*`.
*orig* is the original exception that was caught, and *excs* is the list of
the exceptions that need to be raised. This list contains the the unhandled
the exceptions that need to be raised. This list contains the unhandled
part of *orig*, if any, as well as the exceptions that were raised from the
:keyword:`!except*` clauses (so they have a different traceback from *orig*) and
those that were reraised (and have the same traceback as *orig*).
Expand Down
25 changes: 22 additions & 3 deletions Doc/c-api/mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
rather than a :c:expr:`PyObject*`.
.. c:function:: int PyMapping_HasKeyWithError(PyObject *o, PyObject *key)
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
This is equivalent to the Python expression ``key in o``.
On failure, return ``-1``.
.. versionadded:: 3.13
.. c:function:: int PyMapping_HasKeyStringWithError(PyObject *o, const char *key)
This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
rather than a :c:expr:`PyObject*`.
.. versionadded:: 3.13
.. c:function:: int PyMapping_HasKey(PyObject *o, PyObject *key)
Return ``1`` if the mapping object has the key *key* and ``0`` otherwise.
Expand All @@ -86,8 +104,8 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
Exceptions which occur when this calls :meth:`~object.__getitem__`
method are silently ignored.
For proper error handling, use :c:func:`PyMapping_GetOptionalItem` or
:c:func:`PyObject_GetItem()` instead.
For proper error handling, use :c:func:`PyMapping_HasKeyWithError`,
:c:func:`PyMapping_GetOptionalItem` or :c:func:`PyObject_GetItem()` instead.
.. c:function:: int PyMapping_HasKeyString(PyObject *o, const char *key)
Expand All @@ -101,7 +119,8 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
Exceptions that occur when this calls :meth:`~object.__getitem__`
method or while creating the temporary :class:`str`
object are silently ignored.
For proper error handling, use :c:func:`PyMapping_GetOptionalItemString` or
For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`,
:c:func:`PyMapping_GetOptionalItemString` or
:c:func:`PyMapping_GetItemString` instead.
Expand Down
25 changes: 22 additions & 3 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ Object Protocol
instead of the :func:`repr`.
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, const char *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
This is equivalent to the Python expression ``hasattr(o, attr_name)``.
On failure, return ``-1``.
.. versionadded:: 3.13
.. c:function:: int PyObject_HasAttrStringWithError(PyObject *o, const char *attr_name)
This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is
specified as a :c:expr:`const char*` UTF-8 encoded bytes string,
rather than a :c:expr:`PyObject*`.
.. versionadded:: 3.13
.. c:function:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
Expand All @@ -37,8 +55,8 @@ Object Protocol
Exceptions that occur when this calls :meth:`~object.__getattr__` and
:meth:`~object.__getattribute__` methods are silently ignored.
For proper error handling, use :c:func:`PyObject_GetOptionalAttr` or
:c:func:`PyObject_GetAttr` instead.
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.
.. c:function:: int PyObject_HasAttrString(PyObject *o, const char *attr_name)
Expand All @@ -52,7 +70,8 @@ Object Protocol
Exceptions that occur when this calls :meth:`~object.__getattr__` and
:meth:`~object.__getattribute__` methods or while creating the temporary
:class:`str` object are silently ignored.
For proper error handling, use :c:func:`PyObject_GetOptionalAttrString`
For proper error handling, use :c:func:`PyObject_HasAttrStringWithError`,
:c:func:`PyObject_GetOptionalAttrString`
or :c:func:`PyObject_GetAttrString` instead.
Expand Down
2 changes: 1 addition & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
highlight_language = 'python3'

# Minimum version of sphinx required
needs_sphinx = '3.2'
needs_sphinx = '4.2'

# Ignore any .rst files in the includes/ directory;
# they're embedded in pages but not rendered individually.
Expand Down
4 changes: 4 additions & 0 deletions Doc/data/stable_abi.dat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Doc/extending/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ modules (including Python) to be able to see your identifiers, you have to say
Developer Studio will throw in a lot of import libraries that you do not really
need, adding about 100K to your executable. To get rid of them, use the Project
Settings dialog, Link tab, to specify *ignore default libraries*. Add the
correct :file:`msvcrtxx.lib` to the list of libraries.
correct :file:`msvcrt{xx}.lib` to the list of libraries.
4 changes: 2 additions & 2 deletions Doc/howto/logging-cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ when (and if) the logged message is actually about to be output to a log by a
handler. So the only slightly unusual thing which might trip you up is that the
parentheses go around the format string and the arguments, not just the format
string. That's because the __ notation is just syntax sugar for a constructor
call to one of the XXXMessage classes.
call to one of the :samp:`{XXX}Message` classes.

If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar effect
to the above, as in the following example::
Expand Down Expand Up @@ -2644,7 +2644,7 @@ when (and if) the logged message is actually about to be output to a log by a
handler. So the only slightly unusual thing which might trip you up is that the
parentheses go around the format string and the arguments, not just the format
string. That’s because the __ notation is just syntax sugar for a constructor
call to one of the ``XXXMessage`` classes shown above.
call to one of the :samp:`{XXX}Message` classes shown above.


.. _filters-dictconfig:
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ provided:

#. :class:`NullHandler` instances do nothing with error messages. They are used
by library developers who want to use logging, but want to avoid the 'No
handlers could be found for logger XXX' message which can be displayed if
handlers could be found for logger *XXX*' message which can be displayed if
the library user has not configured logging. See :ref:`library-config` for
more information.

Expand Down
Loading

0 comments on commit e54350f

Please sign in to comment.