Skip to content

Commit

Permalink
Merge branch 'main' into gh-93963/remove-importlib-resources-abcs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco authored Jul 9, 2022
2 parents 96f14c2 + 78307c7 commit 691a82a
Show file tree
Hide file tree
Showing 709 changed files with 20,129 additions and 13,253 deletions.
47 changes: 24 additions & 23 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,27 @@ PCbuild/readme.txt dos
#
[attr]generated linguist-generated=true diff=generated

**/clinic/*.c.h generated
*_db.h generated
Doc/data/stable_abi.dat generated
Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Objects/typeslots.inc generated
PC/python3dll.c generated
Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
**/clinic/*.c.h generated
*_db.h generated
Doc/data/stable_abi.dat generated
Doc/library/token-list.inc generated
Include/internal/pycore_ast.h generated
Include/internal/pycore_ast_state.h generated
Include/internal/pycore_opcode.h generated
Include/internal/pycore_runtime_init_generated.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Objects/typeslots.inc generated
PC/python3dll.c generated
Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
aclocal.m4 generated
configure generated
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ Python/pythonrun.c @iritkatriel
/Lib/html/ @ezio-melotti
/Lib/_markupbase.py @ezio-melotti
/Lib/test/test_html*.py @ezio-melotti
/Tools/scripts/*html5* @ezio-melotti

# Import (including importlib).
# Ignoring importlib.h so as to not get flagged on
# all pull requests that change the emitted
# bytecode.
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/importlib/resources/* @jaraco @warsaw @brettcannon
**/importlib/metadata/* @jaraco @warsaw

# Dates and times
**/*datetime* @pganssle @abalkin
Expand Down Expand Up @@ -95,7 +98,7 @@ Lib/ast.py @isidentical

# Mock
/Lib/unittest/mock.py @cjw296
/Lib/unittest/test/testmock/* @cjw296
/Lib/test/test_unittest/testmock/* @cjw296

# SQLite 3
**/*sqlite* @berkerpeksag @erlend-aasland
Expand Down
37 changes: 8 additions & 29 deletions .github/workflows/build_msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,27 @@ on:
push:
branches:
- 'main'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
- '3.*'
paths:
- 'Tools/msi/**'
pull_request:
branches:
- 'main'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
- '3.*'
paths:
- 'Tools/msi/**'

permissions:
contents: read

jobs:
build_win32:
name: 'Windows (x86) Installer'
build:
name: Windows Installer
runs-on: windows-latest
strategy:
matrix:
type: [x86, x64, arm64]
steps:
- uses: actions/checkout@v3
- name: Build CPython installer
run: .\Tools\msi\build.bat -x86

build_win_amd64:
name: 'Windows (x64) Installer'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build CPython installer
run: .\Tools\msi\build.bat -x64

build_win_arm64:
name: 'Windows (ARM64) Installer'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build CPython installer
run: .\Tools\msi\build.bat -arm64
run: .\Tools\msi\build.bat -${{ matrix.type }}
19 changes: 19 additions & 0 deletions .github/workflows/project-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Update GH projects

on:
issues:
types:
- opened
- labeled

jobs:
add-to-project:
name: Add to the Release and Deferred Blocker project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.1.0
with:
project-url: https://github.com/orgs/python/projects/2
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: release-blocker, deferred-blocker
label-operator: OR
8 changes: 8 additions & 0 deletions .github/workflows/regen-abidump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -ex

export DEBIAN_FRONTEND=noninteractive
./.github/workflows/posix-deps-apt.sh
apt-get install -yq abigail-tools python3
export CFLAGS="-g3 -O0"
./configure --enable-shared && make
make regen-abidump
28 changes: 28 additions & 0 deletions .github/workflows/verify-ensurepip-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Verify bundled pip and setuptools

on:
workflow_dispatch:
push:
paths:
- 'Lib/ensurepip/_bundled/**'
- '.github/workflows/verify-ensurepip-wheels.yml'
- 'Tools/scripts/verify_ensurepip_wheels.py'
pull_request:
paths:
- 'Lib/ensurepip/_bundled/**'
- '.github/workflows/verify-ensurepip-wheels.yml'
- 'Tools/scripts/verify_ensurepip_wheels.py'

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3'
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
run: ./Tools/scripts/verify_ensurepip_wheels.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ Python/frozen_modules/MANIFEST
# Ignore ./python binary on Unix but still look into ./Python/ directory.
/python
!/Python/

# main branch only: ABI files are not checked/maintained
Doc/data/python*.abi
2 changes: 1 addition & 1 deletion Doc/c-api/allocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Allocating Objects on the Heap
.. c:function:: PyObject* PyObject_Init(PyObject *op, PyTypeObject *type)
Initialize a newly-allocated object *op* with its type and initial
Initialize a newly allocated object *op* with its type and initial
reference. Returns the initialized object. If *type* indicates that the
object participates in the cyclic garbage detector, it is added to the
detector's set of observed objects. Other fields of the object are not
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ A full list of the various types of debugging builds is in the file
:file:`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are
available that support tracing of reference counts, debugging the memory
allocator, or low-level profiling of the main interpreter loop. Only the most
frequently-used builds will be described in the remainder of this section.
frequently used builds will be described in the remainder of this section.

Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined produces
what is generally meant by :ref:`a debug build of Python <debug-build>`.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ memory manager. For example, this is required when the interpreter is extended
with new object types written in C. Another reason for using the Python heap is
the desire to *inform* the Python memory manager about the memory needs of the
extension module. Even when the requested memory is used exclusively for
internal, highly-specific purposes, delegating all memory requests to the Python
internal, highly specific purposes, delegating all memory requests to the Python
memory manager causes the interpreter to have a more accurate image of its
memory footprint as a whole. Consequently, under certain circumstances, the
Python memory manager may or may not trigger appropriate actions, like garbage
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ type objects) *must* have the :attr:`ob_size` field.
``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects
<static-types>`, these fields always remain ``NULL``. For :ref:`dynamically
allocated objects <heap-types>`, these two fields are used to link the
object into a doubly-linked list of *all* live objects on the heap.
object into a doubly linked list of *all* live objects on the heap.

This could be used for various debugging purposes; currently the only uses
are the :func:`sys.getobjects` function and to print the objects that are
Expand Down Expand Up @@ -2523,11 +2523,11 @@ Slot Type typedefs

.. c:type:: PyObject *(*descrgetfunc)(PyObject *, PyObject *, PyObject *)
See :c:member:`~PyTypeObject.tp_descrget`.
See :c:member:`~PyTypeObject.tp_descr_get`.

.. c:type:: int (*descrsetfunc)(PyObject *, PyObject *, PyObject *)
See :c:member:`~PyTypeObject.tp_descrset`.
See :c:member:`~PyTypeObject.tp_descr_set`.

.. c:type:: Py_hash_t (*hashfunc)(PyObject *)
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ as much as it can.
callable object that receives notification when *ob* is garbage collected; it
should accept a single parameter, which will be the weak reference object
itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a
weakly-referencable object, or if *callback* is not callable, ``None``, or
weakly referencable object, or if *callback* is not callable, ``None``, or
``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.
Expand All @@ -47,7 +47,7 @@ as much as it can.
be a callable object that receives notification when *ob* is garbage
collected; it should accept a single parameter, which will be the weak
reference object itself. *callback* may also be ``None`` or ``NULL``. If *ob*
is not a weakly-referencable object, or if *callback* is not callable,
is not a weakly referencable object, or if *callback* is not callable,
``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.
Expand Down
2 changes: 0 additions & 2 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,3 @@
# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the
# documentation is built with -W (warnings treated as errors).
c_warn_on_allowed_pre_v3 = False

strip_signature_backslash = True
4 changes: 2 additions & 2 deletions Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ API Reference
and other APIs, makes the API consistent across different Python versions,
and is hence recommended over using ``distutils`` directly.

.. _New and changed setup.py arguments in setuptools: https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords
.. _New and changed setup.py arguments in setuptools: https://web.archive.org/web/20210614192516/https://setuptools.pypa.io/en/stable/userguide/keywords.html

.. include:: ./_setuptools_disclaimer.rst

Expand Down Expand Up @@ -1198,7 +1198,7 @@ other utility module.
it contains certain values: see :func:`check_environ`. Raise :exc:`ValueError`
for any variables not found in either *local_vars* or ``os.environ``.

Note that this is not a fully-fledged string interpolation function. A valid
Note that this is not a full-fledged string interpolation function. A valid
``$variable`` can consist only of upper and lower case letters, numbers and an
underscore. No { } or ( ) style quoting is available.

Expand Down
2 changes: 1 addition & 1 deletion Doc/extending/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The initialization function has the signature:

.. c:function:: PyObject* PyInit_modulename(void)
It returns either a fully-initialized module, or a :c:type:`PyModuleDef`
It returns either a fully initialized module, or a :c:type:`PyModuleDef`
instance. See :ref:`initializing-modules` for details.
.. highlight:: python
Expand Down
4 changes: 2 additions & 2 deletions Doc/extending/newtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ example::
}

If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the interpreter will supply a
representation that uses the type's :c:member:`~PyTypeObject.tp_name` and a uniquely-identifying
representation that uses the type's :c:member:`~PyTypeObject.tp_name` and a uniquely identifying
value for the object.

The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:member:`~PyTypeObject.tp_repr` handler
Expand Down Expand Up @@ -589,7 +589,7 @@ with the required field::
PyObject *weakreflist; /* List of weak references */
} TrivialObject;

And the corresponding member in the statically-declared type object::
And the corresponding member in the statically declared type object::

static PyTypeObject TrivialType = {
PyVarObject_HEAD_INIT(NULL, 0)
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ you're too lazy to define a function.

Functions are already first class objects in Python, and can be declared in a
local scope. Therefore the only advantage of using a lambda instead of a
locally-defined function is that you don't need to invent a name for the
locally defined function is that you don't need to invent a name for the
function -- but that's just a local variable to which the function object (which
is exactly the same type of object that a lambda expression yields) is assigned!

Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ A summary of available frameworks is maintained by Paul Boddie at
https://wiki.python.org/moin/WebProgramming\ .
Cameron Laird maintains a useful set of pages about Python web technologies at
http://phaseit.net/claird/comp.lang.python/web_python.
https://web.archive.org/web/20210224183619/http://phaseit.net/claird/comp.lang.python/web_python.
How can I mimic CGI form submission (METHOD=POST)?
Expand Down
11 changes: 6 additions & 5 deletions Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Are there tools to help find bugs or perform static analysis?

Yes.

`Pylint <https://www.pylint.org/>`_ and
`Pylint <https://pylint.pycqa.org/en/latest/index.html>`_ and
`Pyflakes <https://github.com/PyCQA/pyflakes>`_ do basic checking that will
help you catch bugs sooner.

Expand Down Expand Up @@ -294,7 +294,7 @@ It's good practice if you import modules in the following order:
1. standard library modules -- e.g. ``sys``, ``os``, ``getopt``, ``re``
2. third-party library modules (anything installed in Python's site-packages
directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc.
3. locally-developed modules
3. locally developed modules

It is sometimes necessary to move imports to a function or class to avoid
problems with circular imports. Gordon McMillan says:
Expand Down Expand Up @@ -409,8 +409,9 @@ What is the difference between arguments and parameters?

:term:`Parameters <parameter>` are defined by the names that appear in a
function definition, whereas :term:`arguments <argument>` are the values
actually passed to a function when calling it. Parameters define what types of
arguments a function can accept. For example, given the function definition::
actually passed to a function when calling it. Parameters define what
:term:`kind of arguments <parameter>` a function can accept. For
example, given the function definition::

def func(foo, bar=None, **kwargs):
pass
Expand Down Expand Up @@ -770,7 +771,7 @@ What does the slash(/) in the parameter list of a function mean?

A slash in the argument list of a function denotes that the parameters prior to
it are positional-only. Positional-only parameters are the ones without an
externally-usable name. Upon calling a function that accepts positional-only
externally usable name. Upon calling a function that accepts positional-only
parameters, arguments are mapped to parameters based solely on their position.
For example, :func:`divmod` is a function that accepts positional-only
parameters. Its documentation looks like this::
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Glossary
machines.

However, some extension modules, either standard or third-party,
are designed so as to release the GIL when doing computationally-intensive
are designed so as to release the GIL when doing computationally intensive
tasks such as compression or hashing. Also, the GIL is always released
when doing I/O.

Expand Down
Loading

0 comments on commit 691a82a

Please sign in to comment.