Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe2db1b

Browse files
Merge branch 'main' into isolate-io/poc
2 parentsab1baf4 +3cba61f commitfe2db1b

File tree

83 files changed

+2773
-1359
lines changed

Some content is hidden

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

83 files changed

+2773
-1359
lines changed

‎.github/dependabot.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ updates:
1212
update-types:
1313
-"version-update:semver-minor"
1414
-"version-update:semver-patch"
15+
-package-ecosystem:"pip"
16+
directory:"/Tools/clinic/"
17+
schedule:
18+
interval:"monthly"
19+
labels:
20+
-"skip issue"
21+
-"skip news"

‎.github/workflows/build.yml‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
timeout-minutes:10
3737
outputs:
3838
run_tests:${{ steps.check.outputs.run_tests }}
39+
run_hypothesis:${{ steps.check.outputs.run_hypothesis }}
3940
steps:
4041
-uses:actions/checkout@v3
4142
-name:Check for source changes
@@ -61,6 +62,17 @@ jobs:
6162
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT ||true
6263
fi
6364
65+
# Check if we should run hypothesis tests
66+
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
67+
echo $GIT_BRANCH
68+
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
69+
echo "Branch too old for hypothesis tests"
70+
echo "run_hypothesis=false" >> $GITHUB_OUTPUT
71+
else
72+
echo "Run hypothesis tests"
73+
echo "run_hypothesis=true" >> $GITHUB_OUTPUT
74+
fi
75+
6476
check_generated_files:
6577
name:'Check if generated files are up to date'
6678
runs-on:ubuntu-latest
@@ -291,6 +303,92 @@ jobs:
291303
-name:SSL tests
292304
run:./python Lib/test/ssltests.py
293305

306+
test_hypothesis:
307+
name:"Hypothesis Tests on Ubuntu"
308+
runs-on:ubuntu-20.04
309+
timeout-minutes:60
310+
needs:check_source
311+
if:needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
312+
env:
313+
OPENSSL_VER:1.1.1t
314+
PYTHONSTRICTEXTENSIONBUILD:1
315+
steps:
316+
-uses:actions/checkout@v3
317+
-name:Register gcc problem matcher
318+
run:echo "::add-matcher::.github/problem-matchers/gcc.json"
319+
-name:Install Dependencies
320+
run:sudo ./.github/workflows/posix-deps-apt.sh
321+
-name:Configure OpenSSL env vars
322+
run:|
323+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
324+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
325+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
326+
-name:'Restore OpenSSL build'
327+
id:cache-openssl
328+
uses:actions/cache@v3
329+
with:
330+
path:./multissl/openssl/${{ env.OPENSSL_VER }}
331+
key:${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
332+
-name:Install OpenSSL
333+
if:steps.cache-openssl.outputs.cache-hit != 'true'
334+
run:python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
335+
-name:Add ccache to PATH
336+
run:|
337+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
338+
-name:Configure ccache action
339+
uses:hendrikmuhs/ccache-action@v1.2
340+
-name:Setup directory envs for out-of-tree builds
341+
run:|
342+
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
343+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
344+
-name:Create directories for read-only out-of-tree builds
345+
run:mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
346+
-name:Bind mount sources read-only
347+
run:sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
348+
-name:Configure CPython out-of-tree
349+
working-directory:${{ env.CPYTHON_BUILDDIR }}
350+
run:../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
351+
-name:Build CPython out-of-tree
352+
working-directory:${{ env.CPYTHON_BUILDDIR }}
353+
run:make -j4
354+
-name:Display build info
355+
working-directory:${{ env.CPYTHON_BUILDDIR }}
356+
run:make pythoninfo
357+
-name:Remount sources writable for tests
358+
# some tests write to srcdir, lack of pyc files slows down testing
359+
run:sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
360+
-name:Setup directory envs for out-of-tree builds
361+
run:|
362+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
363+
-name:"Create hypothesis venv"
364+
working-directory:${{ env.CPYTHON_BUILDDIR }}
365+
run:|
366+
VENV_LOC=$(realpath -m .)/hypovenv
367+
VENV_PYTHON=$VENV_LOC/bin/python
368+
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
369+
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
370+
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -U hypothesis
371+
-name:"Run tests"
372+
working-directory:${{ env.CPYTHON_BUILDDIR }}
373+
run:|
374+
# Most of the excluded tests are slow test suites with no property tests
375+
#
376+
# (GH-104097) test_sysconfig is skipped because it has tests that are
377+
# failing when executed from inside a virtual environment.
378+
${{ env.VENV_PYTHON }} -m test \
379+
-W \
380+
-o \
381+
-j4 \
382+
-x test_asyncio \
383+
-x test_multiprocessing_fork \
384+
-x test_multiprocessing_forkserver \
385+
-x test_multiprocessing_spawn \
386+
-x test_concurrent_futures \
387+
-x test_socket \
388+
-x test_subprocess \
389+
-x test_signal \
390+
-x test_sysconfig
391+
294392
295393
build_asan:
296394
name:'Address sanitizer'

‎.github/workflows/mypy.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Workflow to run mypy on select parts of the CPython repo
2+
name:mypy
3+
4+
on:
5+
push:
6+
branches:
7+
-main
8+
pull_request:
9+
paths:
10+
-"Tools/clinic/**"
11+
-".github/workflows/mypy.yml"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents:read
16+
17+
env:
18+
PIP_DISABLE_PIP_VERSION_CHECK:1
19+
FORCE_COLOR:1
20+
TERM:xterm-256color# needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817
21+
22+
concurrency:
23+
group:${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress:true
25+
26+
jobs:
27+
mypy:
28+
name:Run mypy on Tools/clinic/
29+
runs-on:ubuntu-latest
30+
timeout-minutes:10
31+
steps:
32+
-uses:actions/checkout@v3
33+
-uses:actions/setup-python@v4
34+
with:
35+
python-version:"3.x"
36+
cache:pip
37+
cache-dependency-path:Tools/clinic/requirements-dev.txt
38+
-run:pip install -r Tools/clinic/requirements-dev.txt
39+
-run:mypy --config-file Tools/clinic/mypy.ini

‎Doc/howto/clinic.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,9 @@ All Argument Clinic converters accept the following arguments:
775775
because:pep:`8` mandates that the Python library may not use
776776
annotations.
777777

778+
``unused``
779+
Wrap the argument with:c:macro:`Py_UNUSED` in the impl function signature.
780+
778781
In addition, some converters accept additional arguments. Here is a list
779782
of these arguments, along with their meanings:
780783

‎Doc/library/atexit.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ at interpreter termination time they will be run in the order ``C``, ``B``,
2020
program is killed by a signal not handled by Python, when a Python fatal
2121
internal error is detected, or when:func:`os._exit` is called.
2222

23+
**Note:** The effect of registering or unregistering functions from within
24+
a cleanup function is undefined.
25+
2326
..versionchanged::3.7
2427
When used with C-API subinterpreters, registered functions
2528
are local to the interpreter they were registered in.

‎Doc/library/functions.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ are always available. They are listed here in alphabetical order.
168168
If:func:`sys.breakpointhook` is not accessible, this function will
169169
raise:exc:`RuntimeError`.
170170

171+
By default, the behavior of:func:`breakpoint` can be changed with
172+
the:envvar:`PYTHONBREAKPOINT` environment variable.
173+
See:func:`sys.breakpointhook` for usage details.
174+
175+
Note that this is not guaranteed if:func:`sys.breakpointhook`
176+
has been replaced.
177+
171178
..audit-event::builtins.breakpoint breakpointhook breakpoint
172179

173180
..versionadded::3.7

‎Doc/library/random.rst‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,10 @@ be found in any statistics text.
334334

335335
..function::gammavariate(alpha, beta)
336336

337-
Gamma distribution. (*Not* the gamma function!) Conditions on the
338-
parameters are ``alpha > 0`` and ``beta > 0``.
337+
Gamma distribution. (*Not* the gamma function!) The shape and
338+
scale parameters, *alpha* and *beta*, must have positive values.
339+
(Calling conventions vary and some sources define 'beta'
340+
as the inverse of the scale).
339341

340342
The probability distribution function is::
341343

@@ -346,7 +348,8 @@ be found in any statistics text.
346348

347349
..function::gauss(mu=0.0, sigma=1.0)
348350

349-
Normal distribution, also called the Gaussian distribution. *mu* is the mean,
351+
Normal distribution, also called the Gaussian distribution.
352+
*mu* is the mean,
350353
and *sigma* is the standard deviation. This is slightly faster than
351354
the:func:`normalvariate` function defined below.
352355

‎Doc/library/typing.rst‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
This module provides runtime support for type hints. The most fundamental
2121
support consists of the types:data:`Any`,:data:`Union`,:data:`Callable`,
22-
:class:`TypeVar`, and:class:`Generic`. For afullspecification, please see
22+
:class:`TypeVar`, and:class:`Generic`. For a specification, please see
2323
:pep:`484`. For a simplified introduction to type hints, see:pep:`483`.
2424

2525

@@ -592,7 +592,7 @@ The module defines the following classes, functions and decorators.
592592
when the checked program targets Python 3.9 or newer.
593593

594594
The deprecated types will be removed from the:mod:`typing` module
595-
in the first Python version released 5 years after the release of Python 3.9.0.
595+
no sooner than the first Python version released 5 years after the release of Python 3.9.0.
596596
See details in:pep:`585`—*Type Hinting Generics In Standard Collections*.
597597

598598

@@ -1291,6 +1291,8 @@ These are not used in annotations. They are building blocks for creating generic
12911291
U = TypeVar('U', bound=str|bytes) # Can be any subtype of the union str|bytes
12921292
V = TypeVar('V', bound=SupportsAbs) # Can be anything with an __abs__ method
12931293

1294+
.. _typing-constrained-typevar:
1295+
12941296
Using a *constrained* type variable, however, means that the ``TypeVar``
12951297
can only ever be solved as being exactly one of the constraints given::
12961298

@@ -1550,7 +1552,7 @@ These are not used in annotations. They are building blocks for creating generic
15501552

15511553
..data::AnyStr
15521554

1553-
``AnyStr`` is a:class:`constrained type variable <TypeVar>` defined as
1555+
``AnyStr`` is a:ref:`constrained type variable<typing-constrained-typevar>` defined as
15541556
``AnyStr = TypeVar('AnyStr', str, bytes)``.
15551557

15561558
It is meant to be used for functions that may accept any kind of string
@@ -2112,7 +2114,7 @@ Other concrete types
21122114
Python 2 is no longer supported, and most type checkers also no longer
21132115
support type checking Python 2 code. Removal of the alias is not
21142116
currently planned, but users are encouraged to use
2115-
:class:`str` instead of ``Text`` wherever possible.
2117+
:class:`str` instead of ``Text``.
21162118

21172119
Abstract Base Classes
21182120
---------------------

‎Doc/whatsnew/3.12.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ Pending Removal in Python 3.14
831831
For use in typing, prefer a union, like ``bytes | bytearray``, or:class:`collections.abc.Buffer`.
832832
(Contributed by Shantanu Jain in:gh:`91896`.)
833833

834+
*:class:`typing.ByteString`, deprecated since Python 3.9, now causes a
835+
:exc:`DeprecationWarning` to be emitted when it is used.
836+
834837
* Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable
835838
bases using the C API.
836839

@@ -1201,6 +1204,8 @@ Build Changes
12011204

12021205
(Contributed by Zhang Na in:gh:`90656`.)
12031206

1207+
* ``PYTHON_FOR_REGEN`` now require Python 3.10 or newer.
1208+
12041209

12051210
C API Changes
12061211
=============

‎Include/internal/pycore_frame.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct _frame {
1919
struct_PyInterpreterFrame*f_frame;/* points to the frame data */
2020
PyObject*f_trace;/* Trace function */
2121
intf_lineno;/* Current line number. Only valid if non-zero */
22-
intf_last_traced_line;/* The last line traced for this frame */
2322
charf_trace_lines;/* Emit per-line trace events? */
2423
charf_trace_opcodes;/* Emit per-opcode trace events? */
2524
charf_fast_as_locals;/* Have the fast locals of this frame been converted to a dict? */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp