8000 Merge branch 'main' into random-shuffle-optimization · python/cpython@a897ac0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a897ac0

Browse files
authored
Merge branch 'main' into random-shuffle-optimization
2 parents de175f7 + 9256be7 commit a897ac0

Some content is hidden

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

64 files changed

+2377
-730
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,50 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43+
check_autoconf_regen:
44+
name: 'Check if Autoconf files are up to date'
45+
# Don't use ubuntu-latest but a specific version to make the job
46+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47+
runs-on: ubuntu-24.04
48+
container:
49+
image: ghcr.io/python/autoconf:2024.10.11.11293396815
50+
timeout-minutes: 60
51+
needs: check_source
52+
if: needs.check_source.outputs.run_tests == 'true'
53+
steps:
54+
- name: Install Git
55+
run: |
56+
apt install git -yq
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
58+
- uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 1
61+
- name: Runner image version
62+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
63+
- name: Check Autoconf and aclocal versions
64+
run: |
65+
grep "Generated by GNU Autoconf 2.71" configure
66+
grep "aclocal 1.16.5" aclocal.m4
67+
grep -q "runstatedir" configure
68+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
69+
- name: Regenerate autoconf files
70+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
71+
run: autoreconf -ivf -Werror
72+
- name: Check for changes
73+
run: |
74+
git add -u
75+
changes=$(git status --porcelain)
76+
# Check for changes in regenerated files
77+
if test -n "$changes"; then
78+
echo "Generated files not up to date."
79+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
80+
echo "configure files must be regenerated with a specific version of autoconf."
81+
echo "$changes"
82+
echo ""
83+
git diff --staged || true
84+
exit 1
85+
fi
86+
4387
check_generated_files:
4488
name: 'Check if generated files are up to date'
4589
# Don't use ubuntu-latest but a specific version to make the job
@@ -69,19 +113,10 @@ jobs:
69113
uses: hendrikmuhs/ccache-action@v1.2
70114
with:
71115
save: false
72-
- name: Check Autoconf and aclocal versions
73-
run: |
74-
grep "Generated by GNU Autoconf 2.71" configure
75-
grep "aclocal 1.16.5" aclocal.m4
76-
grep -q "runstatedir" configure
77-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
78116
- name: Configure CPython
79117
run: |
80118
# Build Python with the libpython dynamic library
81119
./configure --config-cache --with-pydebug --enable-shared
82-
- name: Regenerate autoconf files
83-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
84-
run: autoreconf -ivf -Werror
85120
- name: Build CPython
86121
run: |
87122
make -j4 regen-all

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: 'Set up Python'
8585
uses: actions/setup-python@v5
8686
with:
87-
python-version: '3.12' # known to work with Sphinx 6.2.1
87+
python-version: '3.13' # known to work with Sphinx 7.2.6
8888
cache: 'pip'
8989
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
9090
- name: 'Install build dependencies'

Doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
highlight_language = 'python3'
9191

9292
# Minimum version of sphinx required
93-
needs_sphinx = '6.2.1'
93+
needs_sphinx = '7.2.6'
9494

9595
# Create table of contents entries for domain objects (e.g. functions, classes,
9696
# attributes, etc.). Default is True.

Doc/library/builtins.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
--------------
88

99
This module provides direct access to all 'built-in' identifiers of Python; for
10-
example, ``builtins.open`` is the full name for the built-in function
11-
:func:`open`. See :ref:`built-in-funcs` and :ref:`built-in-consts` for
12-
documentation.
13-
10+
example, ``builtins.open`` is the full name for the built-in function :func:`open`.
1411

1512
This module is not normally accessed explicitly by most applications, but can be
1613
useful in modules that provide objects with the same name as a built-in value,
@@ -40,3 +37,10 @@ available as part of their globals. The value of ``__builtins__`` is normally
4037
either this module or the value of this module's :attr:`~object.__dict__` attribute.
4138
Since this is an implementation detail, it may not be used by alternate
4239
implementations of Python.
40+
41+
.. seealso::
42+
43+
* :ref:`built-in-consts`
44+
* :ref:`bltin-exceptions`
45+
* :ref:`built-in-funcs`
46+
* :ref:`bltin-types`

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5579,7 +5579,7 @@ Miscellaneous System Information
55795579
If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is set,
55805580
:func:`process_cpu_count` returns the overridden value *n*.
55815581

5582-
See also the :func:`sched_getaffinity` functions.
5582+
See also the :func:`sched_getaffinity` function.
55835583

55845584
.. versionadded:: 3.13
55855585

Doc/requirements-oldest-sphinx.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ blurb
77
python-docs-theme>=2022.1
88

99
# Generated from:
10-
# pip install "Sphinx~=6.2.1"
10+
# pip install "Sphinx~=7.2.6"
1111
# pip freeze
1212
#
13-
# Sphinx 6.2.1 comes from ``needs_sphinx = '6.2.1'`` in ``Doc/conf.py``.
13+
# Sphinx 7.2.6 comes from ``needs_sphinx = '7.2.6'`` in ``Doc/conf.py``.
1414

1515
alabaster==0.7.16
16-
Babel==2.15.0
17-
certifi==2024.7.4
18-
charset-normalizer==3.3.2
19-
docutils==0.19
20-
idna==3.7
16+
Babel==2.16.0
17+
certifi==2024.8.30
18+
charset-normalizer==3.4.0
19+
docutils==0.20.1
20+
idna==3.10
2121
imagesize==1.4.1
2222
Jinja2==3.1.4
23-
MarkupSafe==2.1.5
23+
MarkupSafe==3.0.1
2424
packaging==24.1
2525
Pygments==2.18.0
2626
requests==2.32.3
2727
snowballstemmer==2.2.0
28-
Sphinx==6.2.1
29-
sphinxcontrib-applehelp==1.0.8
30-
sphinxcontrib-devhelp==1.0.6
31-
sphinxcontrib-htmlhelp==2.0.5
28+
Sphinx==7.2.6
29+
sphinxcontrib-applehelp==2.0.0
30+
sphinxcontrib-devhelp==2.0.0
31+
sphinxcontrib-htmlhelp==2.1.0
3232
sphinxcontrib-jsmath==1.0.1
33-
sphinxcontrib-qthelp==1.0.7
34-
sphinxcontrib-serializinghtml==1.1.10
35-
urllib3==2.2.2
33+
sphinxcontrib-qthelp==2.0.0
34+
sphinxcontrib-serializinghtml==2.0.0
35+
urllib3==2.2.3

Doc/whatsnew/3.14.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ argparse
210210
interpreter was instructed to find the ``__main__`` module code.
211211
(Contributed by Serhiy Storchaka and Alyssa Coghlan in :gh:`66436`.)
212212

213+
* Introduced the optional *suggest_on_error* parameter to
214+
:class:`argparse.ArgumentParser`, enabling suggestions for argument choices
215+
and subparser names if mistyped by the user.
216+
(Contributed by Savannah Ostrowski in :gh:`124456`)
217+
213218
ast
214219
---
215220

Include/Python.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
#include "pylifecycle.h"
125125
#include "ceval.h"
126126
#include "sysmodule.h"
127+
#include "audit.h"
127128
#include "osmodule.h"
128129
#include "intrcheck.h"
129130
#include "import.h"

Include/audit.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef Py_AUDIT_H
2+
#define Py_AUDIT_H
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
7+
8+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
9+
PyAPI_FUNC(int) PySys_Audit(
10+
const char *event,
11+
const char *argFormat,
12+
...);
13+
14+
PyAPI_FUNC(int) PySys_AuditTuple(
15+
const char *event,
16+
PyObject *args);
17+
#endif
18+
19+
20+
#ifndef Py_LIMITED_API
21+
# define Py_CPYTHON_AUDIT_H
22+
# include "cpython/audit.h"
23+
# undef Py_CPYTHON_AUDIT_H
24+
#endif
25+
26+
27+
#ifdef __cplusplus
28+
}
29+
#endif
30+
#endif /* !Py_AUDIT_H */

Include/cpython/audit.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef Py_CPYTHON_AUDIT_H
2+
# error "this header file must not be included directly"
3+
#endif
4+
5+
6+
typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
7+
8+
PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);

0 commit comments

Comments
 (0)
0