Skip to content

Commit

Permalink
Merge branch 'python:3.12' into 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesDup authored Jul 17, 2023
2 parents b3be3c9 + 497bfd5 commit 61ea682
Show file tree
Hide file tree
Showing 274 changed files with 36,224 additions and 30,416 deletions.
14 changes: 0 additions & 14 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
47 changes: 0 additions & 47 deletions .azure-pipelines/docs-steps.yml

This file was deleted.

12 changes: 0 additions & 12 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
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ Lib/ast.py @isidentical
**/*pathlib* @barneygale

# zipfile.Path
**/*zipfile/*_path.py @jaraco
**/*zipfile/_path/* @jaraco
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ 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: |
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
Expand All @@ -248,7 +248,7 @@ jobs:
--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 Down
4 changes: 0 additions & 4 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,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 Down Expand Up @@ -82,8 +80,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
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ repos:
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
types: [python]
exclude: Lib/test/coding20731.py
- 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
25 changes: 14 additions & 11 deletions Doc/c-api/bool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Boolean Objects
---------------

Booleans in Python are implemented as a subclass of integers. There are only
two booleans, :const:`Py_False` and :const:`Py_True`. As such, the normal
two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the normal
creation and deletion functions don't apply to booleans. The following macros
are available, however.

Expand All @@ -19,29 +19,32 @@ are available, however.
.. c:var:: PyObject* Py_False
The Python ``False`` object. This object has no methods. It needs to be
treated just like any other object with respect to reference counts.
The Python ``False`` object. This object has no methods and is
`immortal <https://peps.python.org/pep-0683/>`_.
.. versionchanged:: 3.12
:c:data:`Py_False` is immortal.
.. c:var:: PyObject* Py_True
The Python ``True`` object. This object has no methods. It needs to be treated
just like any other object with respect to reference counts.
The Python ``True`` object. This object has no methods and is
`immortal <https://peps.python.org/pep-0683/>`_.
.. versionchanged:: 3.12
:c:data:`Py_True` is immortal.
.. c:macro:: Py_RETURN_FALSE
Return :const:`Py_False` from a function, properly incrementing its reference
count.
Return :c:data:`Py_False` from a function.
.. c:macro:: Py_RETURN_TRUE
Return :const:`Py_True` from a function, properly incrementing its reference
count.
Return :c:data:`Py_True` from a function.
.. c:function:: PyObject* PyBool_FromLong(long v)
Return a new reference to :const:`Py_True` or :const:`Py_False` depending on the
truth value of *v*.
Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value of *v*.
10 changes: 5 additions & 5 deletions Doc/c-api/complex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ Complex Numbers as Python Objects
Return the :c:type:`Py_complex` value of the complex number *op*.
If *op* is not a Python complex number object but has a :meth:`__complex__`
If *op* is not a Python complex number object but has a :meth:`~object.__complex__`
method, this method will first be called to convert *op* to a Python complex
number object. If ``__complex__()`` is not defined then it falls back to
:meth:`__float__`. If ``__float__()`` is not defined then it falls back
to :meth:`__index__`. Upon failure, this method returns ``-1.0`` as a real
number object. If :meth:`!__complex__` is not defined then it falls back to
:meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back
to :meth:`~object.__index__`. Upon failure, this method returns ``-1.0`` as a real
value.
.. versionchanged:: 3.8
Use :meth:`__index__` if available.
Use :meth:`~object.__index__` if available.
19 changes: 12 additions & 7 deletions Doc/c-api/dict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ Dictionary Objects
Return the object from dictionary *p* which has a key *key*. Return ``NULL``
if the key *key* is not present, but *without* setting an exception.
Note that exceptions which occur while calling :meth:`__hash__` and
:meth:`__eq__` methods will get suppressed.
To get error reporting use :c:func:`PyDict_GetItemWithError()` instead.
.. note::
Exceptions that occur while this calls :meth:`~object.__hash__` and
:meth:`~object.__eq__` methods are silently ignored.
Prefer the :c:func:`PyDict_GetItemWithError` function instead.
.. versionchanged:: 3.10
Calling this API without :term:`GIL` held had been allowed for historical
Expand All @@ -120,10 +122,13 @@ Dictionary Objects
This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
:c:expr:`const char*`, rather than a :c:expr:`PyObject*`.
Note that exceptions which occur while calling :meth:`__hash__` and
:meth:`__eq__` methods and creating a temporary string object
will get suppressed.
To get error reporting use :c:func:`PyDict_GetItemWithError()` instead.
.. note::
Exceptions that occur while this calls :meth:`~object.__hash__` and
:meth:`~object.__eq__` methods or while creating the temporary :class:`str`
object are silently ignored.
Prefer using the :c:func:`PyDict_GetItemWithError` function with your own
:c:func:`PyUnicode_FromString` *key* instead.
.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *defaultobj)
Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/float.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. _floatobjects:

Floating Point Objects
----------------------
======================

.. index:: pair: object; floating point

Expand Down Expand Up @@ -45,14 +45,14 @@ Floating Point Objects
.. c:function:: double PyFloat_AsDouble(PyObject *pyfloat)
Return a C :c:expr:`double` representation of the contents of *pyfloat*. If
*pyfloat* is not a Python floating point object but has a :meth:`__float__`
*pyfloat* is not a Python floating point object but has a :meth:`~object.__float__`
method, this method will first be called to convert *pyfloat* into a float.
If ``__float__()`` is not defined then it falls back to :meth:`__index__`.
If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`.
This method returns ``-1.0`` upon failure, so one should call
:c:func:`PyErr_Occurred` to check for errors.
.. versionchanged:: 3.8
Use :meth:`__index__` if available.
Use :meth:`~object.__index__` if available.
.. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)
Expand All @@ -79,7 +79,7 @@ Floating Point Objects
Pack and Unpack functions
=========================
-------------------------
The pack and unpack functions provide an efficient platform-independent way to
store floating-point values as byte strings. The Pack routines produce a bytes
Expand All @@ -104,7 +104,7 @@ happens in such cases is partly accidental (alas).
.. versionadded:: 3.11
Pack functions
--------------
^^^^^^^^^^^^^^
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
Expand Down Expand Up @@ -135,7 +135,7 @@ There are two problems on non-IEEE platforms:
Unpack functions
----------------
^^^^^^^^^^^^^^^^
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
:c:expr:`int` argument, non-zero if the bytes string is in little-endian format
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ See also :ref:`Reflection <reflection>`.
Internal Frames
---------------
^^^^^^^^^^^^^^^
Unless using :pep:`523`, you will not need this.
Expand Down
Loading

0 comments on commit 61ea682

Please sign in to comment.