Skip to content

Commit

Permalink
Merge branch 'main' into inspect-signature
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Dec 12, 2022
2 parents 126b8c3 + 70be5e4 commit fef9787
Show file tree
Hide file tree
Showing 1,461 changed files with 57,101 additions and 59,488 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ 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/internal/pycore_*_generated.h generated
Include/opcode.h generated
Include/token.h generated
Lib/keyword.py generated
Expand All @@ -82,6 +82,7 @@ Parser/parser.c generated
Parser/token.c generated
Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/generated_cases.c.h generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
Expand Down
11 changes: 7 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.github/** @ezio-melotti

# asyncio
**/*asyncio* @1st1 @asvetlov @gvanrossum
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303

# Core
**/*context* @1st1
Expand Down Expand Up @@ -63,7 +63,7 @@ Python/traceback.c @iritkatriel
# bytecode.
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
**/*importlib/resources/* @jaraco @warsaw @brettcannon
**/*importlib/resources/* @jaraco @warsaw @brettcannon @FFY00
**/importlib/metadata/* @jaraco @warsaw

# Dates and times
Expand Down Expand Up @@ -137,8 +137,6 @@ Lib/ast.py @isidentical

**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood

**/*asyncore @giampaolo
**/*asynchat @giampaolo
**/*ftplib @giampaolo
**/*shutil @giampaolo

Expand All @@ -148,9 +146,14 @@ Lib/ast.py @isidentical

**/*tomllib* @encukou

**/*sysconfig* @FFY00

# macOS
/Mac/ @python/macos-team
**/*osx_support* @python/macos-team

# pathlib
**/*pathlib* @brettcannon

# zipfile.Path
**/*zipfile/*_path.py @jaraco
16 changes: 2 additions & 14 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@ Contributing to Python
Build Status
------------

- main
- `Buildbot status overview <https://buildbot.python.org/all/#/release_status>`_

+ `Stable buildbots <https://buildbot.python.org/3.x.stable/>`_

- 3.9

+ `Stable buildbots <https://buildbot.python.org/3.9.stable/>`_

- 3.8

+ `Stable buildbots <https://buildbot.python.org/3.8.stable/>`_

- 3.7

+ `Stable buildbots <https://buildbot.python.org/3.7.stable/>`_
- `GitHub Actions status <https://github.com/python/cpython/actions/workflows/build.yml>`_


Thank You
Expand Down
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Python team applies security fixes according to the table
in [the devguide](
https://devguide.python.org/#status-of-python-branches
https://devguide.python.org/versions/#supported-versions
).

## Reporting a Vulnerability
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1q
OPENSSL_VER: 1.1.1s
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openssl_ver: [1.1.1q, 3.0.5]
openssl_ver: [1.1.1s, 3.0.7]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1q
OPENSSL_VER: 1.1.1s
PYTHONSTRICTEXTENSIONBUILD: 1
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
steps:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ jobs:
run: make -C Doc/ venv
- name: 'Check documentation'
run: make -C Doc/ check
- name: 'Upload NEWS'
uses: actions/upload-artifact@v3
with:
name: NEWS
path: Doc/build/NEWS
- name: 'Build HTML documentation'
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
- name: 'Upload'
- name: 'Upload docs'
uses: actions/upload-artifact@v3
with:
name: doc-html
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ gmon.out
.DS_Store

*.exe
!Lib/distutils/command/*.exe

# Ignore core dumps... but not Tools/msi/core/ or the like.
core
Expand All @@ -58,7 +57,6 @@ Doc/.venv/
Doc/env/
Doc/.env/
Include/pydtrace_probes.h
Lib/distutils/command/*.pdb
Lib/lib2to3/*.pickle
Lib/site-packages/*
!Lib/site-packages/README.txt
Expand Down Expand Up @@ -116,6 +114,7 @@ PCbuild/win32/
Tools/unicode/data/
/autom4te.cache
/build/
/builddir/
/config.cache
/config.log
/config.status
Expand Down
28 changes: 24 additions & 4 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ PAPEROPT_letter = -D latex_elements.papersize=letterpaper
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j auto \
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)

.PHONY: help build html htmlhelp latex text texinfo epub changes linkcheck \
coverage doctest pydoc-topics htmlview clean clean-venv venv dist check serve \
autobuild-dev autobuild-dev-html autobuild-stable autobuild-stable-html

.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " clean to remove build files"
Expand All @@ -44,6 +41,7 @@ help:
@echo " dist to create a \"dist\" directory with archived docs for download"
@echo " check to run a check for frequent markup errors"

.PHONY: build
build:
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
Expand All @@ -70,70 +68,85 @@ build:
$(SPHINXBUILD) $(ALLSPHINXOPTS)
@echo

.PHONY: html
html: BUILDER = html
html: build
@echo "Build finished. The HTML pages are in build/html."

.PHONY: htmlhelp
htmlhelp: BUILDER = htmlhelp
htmlhelp: build
@echo "Build finished; now you can run HTML Help Workshop with the" \
"build/htmlhelp/pydoc.hhp project file."

.PHONY: latex
latex: BUILDER = latex
latex: build
@echo "Build finished; the LaTeX files are in build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."

.PHONY: text
text: BUILDER = text
text: build
@echo "Build finished; the text files are in build/text."

.PHONY: texinfo
texinfo: BUILDER = texinfo
texinfo: build
@echo "Build finished; the python.texi file is in build/texinfo."
@echo "Run \`make info' in that directory to run it through makeinfo."

.PHONY: epub
epub: BUILDER = epub
epub: build
@echo "Build finished; the epub files are in build/epub."

.PHONY: changes
changes: BUILDER = changes
changes: build
@echo "The overview file is in build/changes."

.PHONY: linkcheck
linkcheck: BUILDER = linkcheck
linkcheck:
@$(MAKE) build BUILDER=$(BUILDER) || { \
echo "Link check complete; look for any errors in the above output" \
"or in build/$(BUILDER)/output.txt"; \
false; }

.PHONY: coverage
coverage: BUILDER = coverage
coverage: build
@echo "Coverage finished; see c.txt and python.txt in build/coverage"

.PHONY: doctest
doctest: BUILDER = doctest
doctest:
@$(MAKE) build BUILDER=$(BUILDER) || { \
echo "Testing of doctests in the sources finished, look at the" \
"results in build/doctest/output.txt"; \
false; }

.PHONY: pydoc-topics
pydoc-topics: BUILDER = pydoc-topics
pydoc-topics: build
@echo "Building finished; now run this:" \
"cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"

.PHONY: htmlview
htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"

.PHONY: clean
clean: clean-venv
-rm -rf build/*

.PHONY: clean-venv
clean-venv:
rm -rf $(VENVDIR)

.PHONY: venv
venv:
@if [ -d $(VENVDIR) ] ; then \
echo "venv already exists."; \
Expand All @@ -145,6 +158,7 @@ venv:
echo "The venv has been created in the $(VENVDIR) directory"; \
fi

.PHONY: dist
dist:
rm -rf dist
mkdir -p dist
Expand Down Expand Up @@ -199,12 +213,14 @@ dist:
rm -r dist/python-$(DISTVERSION)-docs-texinfo
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/

.PHONY: serve
serve:
@echo "The serve target was removed, use htmlview instead (see bpo-36329)"

Expand All @@ -216,22 +232,26 @@ serve:
# output files)

# for development releases: always build
.PHONY: autobuild-dev
autobuild-dev:
make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'

# for quick rebuilds (HTML only)
.PHONY: autobuild-dev-html
autobuild-dev-html:
make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'

# for stable releases: only build if not in pre-release stage (alpha, beta)
# release candidate downloads are okay, since the stable tree can be in that stage
.PHONY: autobuild-stable
autobuild-stable:
@case $(DISTVERSION) in *[ab]*) \
echo "Not building; $(DISTVERSION) is not a release version."; \
exit 1;; \
esac
@make autobuild-dev

.PHONY: autobuild-stable-html
autobuild-stable-html:
@case $(DISTVERSION) in *[ab]*) \
echo "Not building; $(DISTVERSION) is not a release version."; \
Expand Down
Binary file added Doc/_static/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Doc/c-api/call.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ This is a pointer to a function with the following signature:
and they must be unique.
If there are no keyword arguments, then *kwnames* can instead be *NULL*.

.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET
.. data:: PY_VECTORCALL_ARGUMENTS_OFFSET

If this flag is set in a vectorcall *nargsf* argument, the callee is allowed
to temporarily change ``args[-1]``. In other words, *args* points to
Expand Down
48 changes: 48 additions & 0 deletions Doc/c-api/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,51 @@ bound into a function.
the free variables. On error, ``NULL`` is returned and an exception is raised.
.. versionadded:: 3.11
.. c:function:: int PyCode_AddWatcher(PyCode_WatchCallback callback)
Register *callback* as a code object watcher for the current interpreter.
Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`.
In case of error (e.g. no more watcher IDs available),
return ``-1`` and set an exception.
.. versionadded:: 3.12
.. c:function:: int PyCode_ClearWatcher(int watcher_id)
Clear watcher identified by *watcher_id* previously returned from
:c:func:`PyCode_AddWatcher` for the current interpreter.
Return ``0`` on success, or ``-1`` and set an exception on error
(e.g. if the given *watcher_id* was never registered.)
.. versionadded:: 3.12
.. c:type:: PyCodeEvent
Enumeration of possible code object watcher events:
- ``PY_CODE_EVENT_CREATE``
- ``PY_CODE_EVENT_DESTROY``
.. versionadded:: 3.12
.. c:type:: int (*PyCode_WatchCallback)(PyCodeEvent event, PyCodeObject* co)
Type of a code object watcher callback function.
If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked
after `co` has been fully initialized. Otherwise, the callback is invoked
before the destruction of *co* takes place, so the prior state of *co*
can be inspected.
Users of this API should not rely on internal runtime implementation
details. Such details may include, but are not limited to, the exact
order and timing of creation and destruction of code objects. While
changes in these details may result in differences observable by watchers
(including whether a callback is invoked or not), it does not change
the semantics of the Python code being executed.
If the callback returns with an exception set, it must return ``-1``; this
exception will be printed as an unraisable exception using
:c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``.
.. versionadded:: 3.12
Loading

0 comments on commit fef9787

Please sign in to comment.