Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d024dd0

Browse files
committed
.
Merge branch 'master' of github.com:python/cpython
2 parents cc7ba06 + 660592f commit d024dd0

File tree

638 files changed

+46947
-19009
lines changed

Some content is hidden

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

638 files changed

+46947
-19009
lines changed

.azure-pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1g
60+
openssl_version: 1.1.1k
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1g
86+
openssl_version: 1.1.1k
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/docs-steps.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ steps:
1212
inputs:
1313
versionSpec: '>=3.6'
1414

15-
- script: python -m pip install sphinx==2.2.0 blurb python-docs-theme
15+
- script: python -m pip install -r requirements.txt
16+
workingDirectory: '$(build.sourcesDirectory)/Doc'
1617
displayName: 'Install build dependencies'
1718

1819
- ${{ if ne(parameters.latex, 'true') }}:

.azure-pipelines/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1g
60+
openssl_version: 1.1.1k
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1g
86+
openssl_version: 1.1.1k
8787

8888
steps:
8989
- template: ./posix-steps.yml

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Parser/asdl.py @isidentical
9191
Parser/asdl_c.py @isidentical
9292
Lib/ast.py @isidentical
9393

94+
# Mock
95+
/Lib/unittest/mock.py @cjw296
96+
/Lib/unittest/test/testmock/* @cjw296
97+
9498
# SQLite 3
9599
**/*sqlite* @berkerpeksag
96100

.github/workflows/build.yml

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ jobs:
2323
runs-on: ubuntu-latest
2424
outputs:
2525
run_tests: ${{ steps.check.outputs.run_tests }}
26+
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
2627
steps:
2728
- uses: actions/checkout@v2
2829
- name: Check for source changes
2930
id: check
3031
run: |
3132
if [ -z "$GITHUB_BASE_REF" ]; then
3233
echo '::set-output name=run_tests::true'
34+
echo '::set-output name=run_ssl_tests::true'
3335
else
3436
git fetch origin $GITHUB_BASE_REF --depth=1
3537
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
@@ -46,6 +48,7 @@ jobs:
4648
#
4749
# https://github.com/python/core-workflow/issues/373
4850
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
51+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name=run_ssl_tests::true' || true
4952
fi
5053
5154
check_generated_files:
@@ -131,13 +134,18 @@ jobs:
131134
needs: check_source
132135
if: needs.check_source.outputs.run_tests == 'true'
133136
env:
134-
OPENSSL_VER: 1.1.1f
137+
OPENSSL_VER: 1.1.1k
135138
steps:
136139
- uses: actions/checkout@v2
137140
- name: Register gcc problem matcher
138141
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
139142
- name: Install Dependencies
140143
run: sudo ./.github/workflows/posix-deps-apt.sh
144+
- name: Configure OpenSSL env vars
145+
run: |
146+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
147+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
148+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
141149
- name: 'Restore OpenSSL build'
142150
id: cache-openssl
143151
uses: actions/[email protected]
@@ -146,12 +154,65 @@ jobs:
146154
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
147155
- name: Install OpenSSL
148156
if: steps.cache-openssl.outputs.cache-hit != 'true'
149-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
157+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
158+
- name: Add ccache to PATH
159+
run: |
160+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
161+
- name: Configure ccache action
162+
uses: hendrikmuhs/ccache-action@v1
150163
- name: Configure CPython
151-
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
164+
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
152165
- name: Build CPython
153166
run: make -j4
154167
- name: Display build info
155168
run: make pythoninfo
156169
- name: Tests
157170
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
171+
172+
build_ubuntu_ssltests:
173+
name: 'Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}'
174+
runs-on: ubuntu-20.04
175+
needs: check_source
176+
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
openssl_ver: [1.1.1k, 3.0.0-alpha14]
181+
env:
182+
OPENSSL_VER: ${{ matrix.openssl_ver }}
183+
MULTISSL_DIR: ${{ github.workspace }}/multissl
184+
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
185+
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
186+
steps:
187+
- uses: actions/checkout@v2
188+
- name: Register gcc problem matcher
189+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
190+
- name: Install Dependencies
191+
run: sudo ./.github/workflows/posix-deps-apt.sh
192+
- name: Configure OpenSSL env vars
193+
run: |
194+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
195+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
196+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
197+
- name: 'Restore OpenSSL build'
198+
id: cache-openssl
199+
uses: actions/[email protected]
200+
with:
201+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
202+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
203+
- name: Install OpenSSL
204+
if: steps.cache-openssl.outputs.cache-hit != 'true'
205+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
206+
- name: Add ccache to PATH
207+
run: |
208+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
209+
- name: Configure ccache action
210+
uses: hendrikmuhs/ccache-action@v1
211+
- name: Configure CPython
212+
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
213+
- name: Build CPython
214+
run: make -j4
215+
- name: Display build info
216+
run: make pythoninfo
217+
- name: SSL tests
218+
run: ./python Lib/test/ssltests.py

.github/workflows/coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: 'Ubuntu (Coverage)'
2626
runs-on: ubuntu-latest
2727
env:
28-
OPENSSL_VER: 1.1.1f
28+
OPENSSL_VER: 1.1.1k
2929
steps:
3030
- uses: actions/checkout@v2
3131
- name: Install Dependencies
@@ -54,6 +54,7 @@ jobs:
5454
python -m test.pythoninfo
5555
export PYTHONPATH=`find .venv -name fullcoverage`
5656
- name: 'Tests with coverage'
57+
timeout-minutes: 100 # 1h40m, ref https://bugs.python.org/issue43888
5758
run: >
5859
source ./.venv/bin/activate &&
5960
xvfb-run python -m coverage

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: 'Install build dependencies'
3737
run: make -C Doc/ PYTHON=../python venv
3838
- name: 'Build documentation'
39-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html
39+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html suspicious
4040
- name: 'Upload'
4141
uses: actions/[email protected]
4242
with:

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apt-get update
33

44
apt-get -yq install \
55
build-essential \
6+
ccache \
67
gdb \
78
lcov \
89
libbz2-dev \

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cache:
1010

1111
env:
1212
global:
13-
- OPENSSL=1.1.1f
13+
- OPENSSL=1.1.1k
1414
- OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}"
1515
- PATH="${OPENSSL_DIR}/bin:$PATH"
1616
- CFLAGS="-I${OPENSSL_DIR}/include"
@@ -53,7 +53,7 @@ matrix:
5353
- cd Doc
5454
- make venv PYTHON=python
5555
script:
56-
- make check html SPHINXOPTS="-q -W -j4"
56+
- make check html suspicious SPHINXOPTS="-q -W -j4"
5757
- name: "Documentation tests"
5858
os: linux
5959
language: c

Doc/c-api/code.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ bound into a function.
5151
Return a new empty code object with the specified filename,
5252
function name, and first line number. It is illegal to
5353
:func:`exec` or :func:`eval` the resulting code object.
54+
55+
.. c:function:: int PyCode_Addr2Line(PyCodeObject *co, int byte_offset)
56+
57+
Return the line number of the instruction that occurs on or before ``byte_offset`` and ends after it.
58+
If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead.
59+
60+
For efficiently iterating over the line numbers in a code object, use `the API described in PEP 626
61+
<https://www.python.org/dev/peps/pep-0626/#out-of-process-debuggers-and-profilers>`_.

0 commit comments

Comments
 (0)