Skip to content

Commit

Permalink
Merge branch 'main' of github.com:python/cpython into pythongh-102251
Browse files Browse the repository at this point in the history
  • Loading branch information
sunmy2019 committed Jun 23, 2023
2 parents 695fd16 + 6a80664 commit 0480053
Show file tree
Hide file tree
Showing 628 changed files with 34,715 additions and 34,642 deletions.
18 changes: 2 additions & 16 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ jobs:
- template: ./prebuild-checks.yml


- job: Docs_PR
displayName: Docs PR
dependsOn: Prebuild
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-22.04

steps:
- template: ./docs-steps.yml
parameters:
upload: true


- job: macOS_CI_Tests
displayName: macOS CI Tests
dependsOn: Prebuild
Expand Down Expand Up @@ -57,7 +43,7 @@ jobs:
variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1t
openssl_version: 1.1.1u

steps:
- template: ./posix-steps.yml
Expand All @@ -83,7 +69,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1t
openssl_version: 1.1.1u

steps:
- template: ./posix-steps.yml
Expand Down
47 changes: 0 additions & 47 deletions .azure-pipelines/docs-steps.yml

This file was deleted.

16 changes: 2 additions & 14 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ jobs:
- template: ./prebuild-checks.yml


- job: Docs_PR
displayName: Docs PR
dependsOn: Prebuild
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-22.04

steps:
- template: ./docs-steps.yml


- job: macOS_PR_Tests
displayName: macOS PR Tests
dependsOn: Prebuild
Expand Down Expand Up @@ -57,7 +45,7 @@ jobs:
variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1t
openssl_version: 1.1.1u

steps:
- template: ./posix-steps.yml
Expand All @@ -83,7 +71,7 @@ jobs:
variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1t
openssl_version: 1.1.1u

steps:
- template: ./posix-steps.yml
Expand Down
12 changes: 0 additions & 12 deletions .azure-pipelines/prebuild-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ steps:
displayName: Fetch comparison tree
condition: and(succeeded(), variables['System.PullRequest.TargetBranch'])

- script: |
if ! git diff --name-only $(diffTarget) | grep -qE '(\.rst$|^Doc|^Misc)'
then
echo "No docs were updated: docs.run=false"
echo "##vso[task.setvariable variable=run;isOutput=true]false"
else
echo "Docs were updated: docs.run=true"
echo "##vso[task.setvariable variable=run;isOutput=true]true"
fi
displayName: Detect documentation changes
name: docs

- script: |
if ! git diff --name-only $(diffTarget) | grep -qvE '(\.rst$|^Doc|^Misc)'
then
Expand Down
8 changes: 7 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Python/traceback.c @iritkatriel
/Tools/build/parse_html5_entities.py @ezio-melotti

# Import (including importlib).
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
**/*importlib/resources/* @jaraco @warsaw @FFY00
**/importlib/metadata/* @jaraco @warsaw

Expand Down Expand Up @@ -118,6 +118,12 @@ Lib/ast.py @isidentical
/Lib/test/test_subprocess.py @gpshead
/Modules/*subprocess* @gpshead

# Limited C API & stable ABI
Tools/build/stable_abi.py @encukou
Misc/stable_abi.toml @encukou
Doc/data/*.abi @encukou
Doc/c-api/stable.rst @encukou

# Windows
/PC/ @python/windows-team
/PCbuild/ @python/windows-team
Expand Down
39 changes: 13 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,9 @@ jobs:
with:
filter: |
Doc/**
# Temporarily skip paths with spaces
# (i.e. "C API", "Core and Builtins")
# to avoid "Error: One of your files includes a space".
# Pending https://github.com/python/core-workflow/issues/186
# Misc/**
Misc/NEWS.d/next/Build/**
Misc/NEWS.d/next/Documentation/**
Misc/NEWS.d/next/IDLE/**
Misc/NEWS.d/next/Library/**
Misc/NEWS.d/next/Security/**
Misc/NEWS.d/next/Tests/**
Misc/NEWS.d/next/Tools-Demos/**
Misc/NEWS.d/next/Windows/**
Misc/NEWS.d/next/macOS/**
Misc/**
.github/workflows/reusable-docs.yml
format: csv # works for paths with spaces
- name: Check for docs changes
if: >-
github.event_name == 'pull_request'
Expand Down Expand Up @@ -136,10 +124,10 @@ jobs:
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
- name: Check Autoconf version 2.69 and aclocal 1.16.3
- name: Check Autoconf and aclocal versions
run: |
grep "Generated by GNU Autoconf 2.69" configure
grep "aclocal 1.16.3" aclocal.m4
grep "Generated by GNU Autoconf 2.71" configure
grep "aclocal 1.16.4" aclocal.m4
grep -q "runstatedir" configure
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
- name: Configure CPython
Expand Down Expand Up @@ -232,17 +220,16 @@ jobs:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
- name: Configure CPython
run: |
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
./configure \
--config-cache \
--with-pydebug \
--prefix=/opt/python-dev \
--with-openssl="$(brew --prefix openssl@1.1)"
--with-openssl="$(brew --prefix openssl@3.0)"
- name: Build CPython
run: make -j4
- name: Display build info
Expand All @@ -257,7 +244,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1t
OPENSSL_VER: 1.1.1u
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -326,7 +313,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
openssl_ver: [1.1.1u, 3.0.9, 3.1.1]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
Expand Down Expand Up @@ -378,7 +365,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
env:
OPENSSL_VER: 1.1.1t
OPENSSL_VER: 1.1.1u
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -487,7 +474,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1t
OPENSSL_VER: 1.1.1u
PYTHONSTRICTEXTENSIONBUILD: 1
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
steps:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
cache-dependency-path: 'Doc/requirements.txt'
- name: 'Install build dependencies'
run: make -C Doc/ venv
- name: 'Check documentation'
run: make -C Doc/ check
- name: 'Build HTML documentation'
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html

Expand All @@ -40,12 +38,14 @@ jobs:
uses: Ana06/get-changed-files@v2.2.0
with:
filter: "Doc/**"
format: csv # works for paths with spaces
- name: 'Build changed files in nit-picky mode'
if: github.event_name == 'pull_request'
continue-on-error: true
run: |
set -Eeuo pipefail
# Mark files the pull request modified
touch ${{ steps.changed_files.outputs.added_modified }}
python Doc/tools/touch-clean-files.py --clean '${{ steps.changed_files.outputs.added_modified }}'
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
python Doc/tools/warnings-to-gh-actions.py
Expand All @@ -59,8 +59,6 @@ jobs:
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
# This build doesn't use problem matchers or check annotations
# It also does not run 'make check', as sphinx-lint is not installed into the
# environment.
build_doc_oldest_supported_sphinx:
name: 'Docs (Oldest Sphinx)'
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ repos:
- id: check-yaml
- id: trailing-whitespace
types_or: [c, python, rst]

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.6.7
hooks:
- id: sphinx-lint
args: [--enable=default-role]
files: ^Doc/
types: [rst]
8 changes: 3 additions & 5 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,9 @@ dist:
rm dist/python-$(DISTVERSION)-docs-texinfo.tar

.PHONY: check
check:
# Check the docs and NEWS files with sphinx-lint.
# Ignore the tools and venv dirs and check that the default role is not used.
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
check: venv
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
$(VENVDIR)/bin/python3 -m pre_commit run --all-files

.PHONY: serve
serve:
Expand Down
1 change: 0 additions & 1 deletion Doc/c-api/abstract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ but whose items have not been set to some non-\ ``NULL`` value yet.
mapping.rst
iter.rst
buffer.rst
objbuffer.rst
24 changes: 16 additions & 8 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,24 @@ API Functions
.. versionadded:: 3.2
.. XXX deprecated, will be removed
.. c:function:: int PyArg_Parse(PyObject *args, const char *format, ...)
Function used to deconstruct the argument lists of "old-style" functions ---
these are functions which use the :const:`METH_OLDARGS` parameter parsing
method, which has been removed in Python 3. This is not recommended for use
in parameter parsing in new code, and most code in the standard interpreter
has been modified to no longer use this for that purpose. It does remain a
convenient way to decompose other tuples, however, and may continue to be
used for that purpose.
Parse the parameter of a function that takes a single positional parameter
into a local variable. Returns true on success; on failure, it returns
false and raises the appropriate exception.
Example::
// Function using METH_O calling convention
static PyObject*
my_function(PyObject *module, PyObject *arg)
{
int value;
if (!PyArg_Parse(arg, "i:my_function", &value)) {
return NULL;
}
// ... use value ...
}
.. c:function:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
Expand Down
Loading

0 comments on commit 0480053

Please sign in to comment.