Skip to content

Commit 369c9d3

Browse files
authored
Merge branch 'main' into glob-duplicates
2 parents a8aba33 + a1a3193 commit 369c9d3

File tree

751 files changed

+28580
-15101
lines changed

Some content is hidden

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

751 files changed

+28580
-15101
lines changed

.azure-pipelines/ci.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@ jobs:
1414
- template: ./prebuild-checks.yml
1515

1616

17-
- job: Docs_PR
18-
displayName: Docs PR
19-
dependsOn: Prebuild
20-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
21-
22-
pool:
23-
vmImage: ubuntu-22.04
24-
25-
steps:
26-
- template: ./docs-steps.yml
27-
parameters:
28-
upload: true
29-
30-
3117
- job: macOS_CI_Tests
3218
displayName: macOS CI Tests
3319
dependsOn: Prebuild

.azure-pipelines/docs-steps.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.azure-pipelines/pr.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ jobs:
1414
- template: ./prebuild-checks.yml
1515

1616

17-
- job: Docs_PR
18-
displayName: Docs PR
19-
dependsOn: Prebuild
20-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
21-
22-
pool:
23-
vmImage: ubuntu-22.04
24-
25-
steps:
26-
- template: ./docs-steps.yml
27-
28-
2917
- job: macOS_PR_Tests
3018
displayName: macOS PR Tests
3119
dependsOn: Prebuild

.azure-pipelines/prebuild-checks.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ steps:
1111
displayName: Fetch comparison tree
1212
condition: and(succeeded(), variables['System.PullRequest.TargetBranch'])
1313

14-
- script: |
15-
if ! git diff --name-only $(diffTarget) | grep -qE '(\.rst$|^Doc|^Misc)'
16-
then
17-
echo "No docs were updated: docs.run=false"
18-
echo "##vso[task.setvariable variable=run;isOutput=true]false"
19-
else
20-
echo "Docs were updated: docs.run=true"
21-
echo "##vso[task.setvariable variable=run;isOutput=true]true"
22-
fi
23-
displayName: Detect documentation changes
24-
name: docs
25-
2614
- script: |
2715
if ! git diff --name-only $(diffTarget) | grep -qvE '(\.rst$|^Doc|^Misc)'
2816
then

.coveragerc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
# Regexes for lines to exclude from consideration
6+
exclude_lines =
7+
# Don't complain if non-runnable code isn't run:
8+
if 0:
9+
if __name__ == .__main__.:
10+
11+
.*# pragma: no cover
12+
.*# pragma: no branch
13+
14+
# Additions for IDLE:
15+
.*# htest #
16+
if not (_htest or _utest):
17+
if not .*_utest:
18+
if .*_htest:
19+

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Parser/parser.c generated
8585
Parser/token.c generated
8686
Programs/test_frozenmain.h generated
8787
Python/Python-ast.c generated
88+
Python/executor_cases.c.h generated
8889
Python/generated_cases.c.h generated
8990
Python/opcode_targets.h generated
9091
Python/stdlib_module_names.h generated

.github/CODEOWNERS

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Doc/library/time.rst @pganssle @abalkin
7979
Lib/test/test_time.py @pganssle @abalkin
8080
Modules/timemodule.c @pganssle @abalkin
8181
Python/pytime.c @pganssle @abalkin
82-
Include/pytime.h @pganssle @abalkin
82+
Include/internal/pycore_time.h @pganssle @abalkin
8383

8484
# Email and related
8585
**/*mail* @python/email-team
@@ -172,4 +172,9 @@ Doc/c-api/stable.rst @encukou
172172
**/*pathlib* @barneygale
173173

174174
# zipfile.Path
175-
**/*zipfile/*_path.py @jaraco
175+
**/*zipfile/_path/* @jaraco
176+
177+
# Argument Clinic
178+
/Tools/clinic/** @erlend-aasland @AlexWaygood
179+
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
180+
Doc/howto/clinic.rst @erlend-aasland

.github/workflows/build.yml

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,9 @@ jobs:
8787
with:
8888
filter: |
8989
Doc/**
90-
# Temporarily skip paths with spaces
91-
# (i.e. "C API", "Core and Builtins")
92-
# to avoid "Error: One of your files includes a space".
93-
# Pending https://github.com/python/core-workflow/issues/186
94-
# Misc/**
95-
Misc/NEWS.d/next/Build/**
96-
Misc/NEWS.d/next/Documentation/**
97-
Misc/NEWS.d/next/IDLE/**
98-
Misc/NEWS.d/next/Library/**
99-
Misc/NEWS.d/next/Security/**
100-
Misc/NEWS.d/next/Tests/**
101-
Misc/NEWS.d/next/Tools-Demos/**
102-
Misc/NEWS.d/next/Windows/**
103-
Misc/NEWS.d/next/macOS/**
90+
Misc/**
10491
.github/workflows/reusable-docs.yml
92+
format: csv # works for paths with spaces
10593
- name: Check for docs changes
10694
if: >-
10795
github.event_name == 'pull_request'
@@ -232,7 +220,7 @@ jobs:
232220
path: config.cache
233221
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
234222
- name: Install Homebrew dependencies
235-
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
223+
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
236224
- name: Configure CPython
237225
run: |
238226
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
@@ -241,7 +229,7 @@ jobs:
241229
--config-cache \
242230
--with-pydebug \
243231
--prefix=/opt/python-dev \
244-
--with-openssl="$(brew --prefix openssl@1.1)"
232+
--with-openssl="$(brew --prefix openssl@3.0)"
245233
- name: Build CPython
246234
run: make -j4
247235
- name: Display build info
@@ -531,3 +519,60 @@ jobs:
531519
run: make pythoninfo
532520
- name: Tests
533521
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
522+
523+
all-required-green: # This job does nothing and is only used for the branch protection
524+
name: All required checks pass
525+
if: always()
526+
527+
needs:
528+
- check_source # Transitive dependency, needed to access `run_tests` value
529+
- check-docs
530+
- check_generated_files
531+
- build_win32
532+
- build_win_amd64
533+
- build_macos
534+
- build_ubuntu
535+
- build_ubuntu_ssltests
536+
- test_hypothesis
537+
- build_asan
538+
539+
runs-on: ubuntu-latest
540+
541+
steps:
542+
- name: Check whether the needed jobs succeeded or failed
543+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
544+
with:
545+
allowed-failures: >-
546+
build_macos,
547+
build_ubuntu_ssltests,
548+
build_win32,
549+
test_hypothesis,
550+
allowed-skips: >-
551+
${{
552+
!fromJSON(needs.check_source.outputs.run-docs)
553+
&& '
554+
check-docs,
555+
'
556+
|| ''
557+
}}
558+
${{
559+
needs.check_source.outputs.run_tests != 'true'
560+
&& '
561+
check_generated_files,
562+
build_win32,
563+
build_win_amd64,
564+
build_macos,
565+
build_ubuntu,
566+
build_ubuntu_ssltests,
567+
build_asan,
568+
'
569+
|| ''
570+
}}
571+
${{
572+
!fromJSON(needs.check_source.outputs.run_hypothesis)
573+
&& '
574+
test_hypothesis,
575+
'
576+
|| ''
577+
}}
578+
jobs: ${{ toJSON(needs) }}

.github/workflows/new-bugs-announce-notifier.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ jobs:
4141
url : issue.data.html_url,
4242
labels : issue.data.labels.map(label => { return label.name }).join(", "),
4343
assignee : issue.data.assignees.map(assignee => { return assignee.login }),
44-
body : issue.data.body
44+
// We need to truncate the body size, because the max size for
45+
// the whole payload is 16kb. We want to be safe and assume that
46+
// body can take up to ~8kb of space.
47+
body : issue.data.body.substring(0, 8000)
4548
};
4649
4750
const data = {

.github/workflows/require-pr-label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
timeout-minutes: 10
1616

1717
steps:
18-
- uses: mheap/github-action-required-labels@v4
18+
- uses: mheap/github-action-required-labels@v5
1919
with:
2020
mode: exactly
2121
count: 0

.github/workflows/reusable-docs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
cache-dependency-path: 'Doc/requirements.txt'
2929
- name: 'Install build dependencies'
3030
run: make -C Doc/ venv
31-
- name: 'Check documentation'
32-
run: make -C Doc/ check
3331
- name: 'Build HTML documentation'
3432
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
3533

@@ -40,12 +38,14 @@ jobs:
4038
uses: Ana06/[email protected]
4139
with:
4240
filter: "Doc/**"
41+
format: csv # works for paths with spaces
4342
- name: 'Build changed files in nit-picky mode'
4443
if: github.event_name == 'pull_request'
4544
continue-on-error: true
4645
run: |
46+
set -Eeuo pipefail
4747
# Mark files the pull request modified
48-
touch ${{ steps.changed_files.outputs.added_modified }}
48+
python Doc/tools/touch-clean-files.py --clean '${{ steps.changed_files.outputs.added_modified }}'
4949
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
5050
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
5151
python Doc/tools/warnings-to-gh-actions.py
@@ -59,8 +59,6 @@ jobs:
5959
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
6060
6161
# This build doesn't use problem matchers or check annotations
62-
# It also does not run 'make check', as sphinx-lint is not installed into the
63-
# environment.
6462
build_doc_oldest_supported_sphinx:
6563
name: 'Docs (Oldest Sphinx)'
6664
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@ repos:
33
rev: v4.4.0
44
hooks:
55
- id: check-yaml
6+
- id: end-of-file-fixer
7+
types: [python]
8+
exclude: Lib/test/coding20731.py
69
- id: trailing-whitespace
710
types_or: [c, python, rst]
11+
12+
- repo: https://github.com/sphinx-contrib/sphinx-lint
13+
rev: v0.6.7
14+
hooks:
15+
- id: sphinx-lint
16+
args: [--enable=default-role]
17+
files: ^Doc/
18+
types: [rst]

Doc/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,9 @@ dist:
216216
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
217217

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

225223
.PHONY: serve
226224
serve:

Doc/c-api/arg.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,24 @@ API Functions
439439
.. versionadded:: 3.2
440440
441441
442-
.. XXX deprecated, will be removed
443442
.. c:function:: int PyArg_Parse(PyObject *args, const char *format, ...)
444443
445-
Function used to deconstruct the argument lists of "old-style" functions ---
446-
these are functions which use the :const:`METH_OLDARGS` parameter parsing
447-
method, which has been removed in Python 3. This is not recommended for use
448-
in parameter parsing in new code, and most code in the standard interpreter
449-
has been modified to no longer use this for that purpose. It does remain a
450-
convenient way to decompose other tuples, however, and may continue to be
451-
used for that purpose.
444+
Parse the parameter of a function that takes a single positional parameter
445+
into a local variable. Returns true on success; on failure, it returns
446+
false and raises the appropriate exception.
447+
448+
Example::
449+
450+
// Function using METH_O calling convention
451+
static PyObject*
452+
my_function(PyObject *module, PyObject *arg)
453+
{
454+
int value;
455+
if (!PyArg_Parse(arg, "i:my_function", &value)) {
456+
return NULL;
457+
}
458+
// ... use value ...
459+
}
452460
453461
454462
.. c:function:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)

0 commit comments

Comments
 (0)