Skip to content

Commit 55ca981

Browse files
Merge branch 'main' into resource-RLIM_INFINITY
2 parents 8b78682 + 9743d06 commit 55ca981

40 files changed

+715
-375
lines changed

.github/workflows/reusable-docs.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ jobs:
7575
--fail-if-regression \
7676
--fail-if-improved \
7777
--fail-if-new-news-nit
78-
- name: 'Build EPUB documentation'
79-
continue-on-error: true
80-
run: |
81-
set -Eeuo pipefail
82-
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet" epub
83-
pip install epubcheck
84-
epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
85-
- name: 'Check for fatal errors in EPUB'
86-
if: github.event_name == 'pull_request'
87-
continue-on-error: true # until gh-136155 is fixed
88-
run: |
89-
python Doc/tools/check-epub.py
9078
9179
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9280
doctest:
@@ -114,3 +102,30 @@ jobs:
114102
# Use "xvfb-run" since some doctest tests open GUI windows
115103
- name: 'Run documentation doctest'
116104
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning" doctest
105+
106+
check-epub:
107+
name: 'Check EPUB'
108+
runs-on: ubuntu-latest
109+
timeout-minutes: 30
110+
steps:
111+
- uses: actions/checkout@v4
112+
with:
113+
persist-credentials: false
114+
- name: 'Set up Python'
115+
uses: actions/setup-python@v5
116+
with:
117+
python-version: '3'
118+
cache: 'pip'
119+
cache-dependency-path: 'Doc/requirements.txt'
120+
- name: 'Install build dependencies'
121+
run: |
122+
make -C Doc/ venv
123+
python -m pip install epubcheck
124+
- name: 'Build EPUB documentation'
125+
run: make -C Doc/ PYTHON=../python epub
126+
- name: 'Run epubcheck'
127+
continue-on-error: true
128+
run: epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
129+
- run: cat Doc/epubcheck.txt
130+
- name: 'Check for fatal errors in EPUB'
131+
run: python Doc/tools/check-epub.py

.well-known/funding-manifest-urls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.python.org/funding.json

Doc/c-api/complex.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ Complex Numbers as Python Objects
118118
119119
This subtype of :c:type:`PyObject` represents a Python complex number object.
120120
121+
.. c:member:: Py_complex cval
122+
123+
The complex number value, using the C :c:type:`Py_complex` representation.
124+
125+
.. deprecated-removed:: next 3.20
126+
Use :c:func:`PyComplex_AsCComplex` and
127+
:c:func:`PyComplex_FromCComplex` to convert a
128+
Python complex number to/from the C :c:type:`Py_complex`
129+
representation.
130+
121131
122132
.. c:var:: PyTypeObject PyComplex_Type
123133
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Pending removal in Python 3.20
2+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3+
4+
* The ``cval`` field in :c:type:`PyComplexObject` (:gh:`128813`).
5+
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
6+
to convert a Python complex number to/from the C :c:type:`Py_complex`
7+
representation.

Doc/deprecations/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ C API deprecations
1818

1919
.. include:: c-api-pending-removal-in-3.18.rst
2020

21+
.. include:: c-api-pending-removal-in-3.20.rst
22+
2123
.. include:: c-api-pending-removal-in-future.rst

Doc/library/difflib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
351351

352352
.. seealso::
353353

354-
`Pattern Matching: The Gestalt Approach <https://www.drdobbs.com/database/pattern-matching-the-gestalt-approach/184407970>`_
354+
`Pattern Matching: The Gestalt Approach <https://jacobfilipp.com/DrDobbs/articles/DDJ/1988/8807/8807c/8807c.htm>`_
355355
Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This
356-
was published in `Dr. Dobb's Journal <https://www.drdobbs.com/>`_ in July, 1988.
356+
was published in Dr. Dobb's Journal in July, 1988.
357357

358358

359359
.. _sequence-matcher:

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ are always available. They are listed here in alphabetical order.
15771577
``pow(base, exp) % mod``). The two-argument form ``pow(base, exp)`` is
15781578
equivalent to using the power operator: ``base**exp``.
15791579

1580-
The arguments must have numeric types. With mixed operand types, the
1580+
When arguments are builtin numeric types with mixed operand types, the
15811581
coercion rules for binary arithmetic operators apply. For :class:`int`
15821582
operands, the result has the same type as the operands (after coercion)
15831583
unless the second argument is negative; in that case, all arguments are

Doc/library/typing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ provides backports of these new features to older versions of Python.
4545

4646
.. seealso::
4747

48-
`"Typing cheat sheet" <https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_
48+
`Typing cheat sheet <https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_
4949
A quick overview of type hints (hosted at the mypy docs)
5050

51-
"Type System Reference" section of `the mypy docs <https://mypy.readthedocs.io/en/stable/index.html>`_
51+
Type System Reference section of `the mypy docs <https://mypy.readthedocs.io/en/stable/index.html>`_
5252
The Python typing system is standardised via PEPs, so this reference
5353
should broadly apply to most Python type checkers. (Some parts may still
5454
be specific to mypy.)
5555

56-
`"Static Typing with Python" <https://typing.python.org/en/latest/>`_
56+
`Static Typing with Python <https://typing.python.org/en/latest/>`_
5757
Type-checker-agnostic documentation written by the community detailing
5858
type system features, useful typing related tools and typing best
5959
practices.
@@ -64,7 +64,7 @@ Specification for the Python Type System
6464
========================================
6565

6666
The canonical, up-to-date specification of the Python type system can be
67-
found at `"Specification for the Python type system" <https://typing.python.org/en/latest/spec/index.html>`_.
67+
found at `Specification for the Python type system <https://typing.python.org/en/latest/spec/index.html>`_.
6868

6969
.. _type-aliases:
7070

@@ -2573,7 +2573,7 @@ types.
25732573
at runtime as soon as the class has been created. Monkey-patching
25742574
attributes onto a runtime-checkable protocol will still work, but will
25752575
have no impact on :func:`isinstance` checks comparing objects to the
2576-
protocol. See :ref:`"What's new in Python 3.12" <whatsnew-typing-py312>`
2576+
protocol. See :ref:`What's new in Python 3.12 <whatsnew-typing-py312>`
25772577
for more details.
25782578

25792579

Doc/tools/check-epub.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
import sys
21
from pathlib import Path
32

3+
CPYTHON_ROOT = Path(
4+
__file__, # cpython/Doc/tools/check-epub.py
5+
'..', # cpython/Doc/tools
6+
'..', # cpython/Doc
7+
'..', # cpython
8+
).resolve()
9+
EPUBCHECK_PATH = CPYTHON_ROOT / 'Doc' / 'epubcheck.txt'
410

5-
def main() -> int:
6-
wrong_directory_msg = "Must run this script from the repo root"
7-
if not Path("Doc").exists() or not Path("Doc").is_dir():
8-
raise RuntimeError(wrong_directory_msg)
9-
10-
with Path("Doc/epubcheck.txt").open(encoding="UTF-8") as f:
11-
messages = [message.split(" - ") for message in f.read().splitlines()]
1211

13-
fatal_errors = [message for message in messages if message[0] == "FATAL"]
12+
def main() -> int:
13+
lines = EPUBCHECK_PATH.read_text(encoding='utf-8').splitlines()
14+
fatal_errors = [line for line in lines if line.startswith('FATAL')]
1415

1516
if fatal_errors:
16-
print("\nError: must not contain fatal errors:\n")
17-
for error in fatal_errors:
18-
print(" - ".join(error))
17+
err_count = len(fatal_errors)
18+
s = 's' * (err_count != 1)
19+
print()
20+
print(f'Error: epubcheck reported {err_count} fatal error{s}:')
21+
print()
22+
print('\n'.join(fatal_errors))
23+
return 1
1924

20-
return len(fatal_errors)
25+
print('Success: no fatal errors found.')
26+
return 0
2127

2228

23-
if __name__ == "__main__":
24-
sys.exit(main())
29+
if __name__ == '__main__':
30+
raise SystemExit(main())

Doc/whatsnew/3.15.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ Deprecated C APIs
570570
signed integer type of the same size is now deprecated.
571571
(Contributed by Serhiy Storchaka in :gh:`132629`.)
572572

573+
* Deprecate :c:member:`~PyComplexObject.cval` field of the the
574+
:c:type:`PyComplexObject` type.
575+
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
576+
to convert a Python complex number to/from the C :c:type:`Py_complex`
577+
representation.
578+
(Contributed by Sergey B Kirpichev in :gh:`128813`.)
579+
573580
* Functions :c:func:`_Py_c_sum`, :c:func:`_Py_c_diff`, :c:func:`_Py_c_neg`,
574581
:c:func:`_Py_c_prod`, :c:func:`_Py_c_quot`, :c:func:`_Py_c_pow` and
575582
:c:func:`_Py_c_abs` are :term:`soft deprecated`.

0 commit comments

Comments
 (0)