Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9083979

Browse files
Merge branch 'main' into isolate-io/poc
2 parents be971d1 + 848bdbe commit 9083979

118 files changed

Lines changed: 5295 additions & 4088 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM docker.io/library/fedora:37
2+
3+
ENV CC=clang
4+
5+
ENV WASI_SDK_VERSION=19
6+
ENV WASI_SDK_PATH=/opt/wasi-sdk
7+
8+
ENV WASMTIME_HOME=/opt/wasmtime
9+
ENV WASMTIME_VERSION=7.0.0
10+
ENV WASMTIME_CPU_ARCH=x86_64
11+
12+
RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \
13+
dnf -y --nodocs builddep python3 && \
14+
dnf -y clean all
15+
16+
RUN mkdir ${WASI_SDK_PATH} && \
17+
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | \
18+
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip
19+
20+
RUN mkdir --parents ${WASMTIME_HOME} && \
21+
curl --location "https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-${WASMTIME_CPU_ARCH}-linux.tar.xz" | \
22+
xz --decompress | \
23+
tar --strip-components 1 --directory ${WASMTIME_HOME} -x && \
24+
ln -s ${WASMTIME_HOME}/wasmtime /usr/local/bin

.devcontainer/devcontainer.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"onCreateCommand": [
6+
// Install common tooling.
7+
"dnf",
8+
"install",
9+
"-y",
10+
"which",
11+
"zsh",
12+
"fish"
13+
],
14+
"updateContentCommand": {
15+
// Using the shell for `nproc` usage.
16+
"python": "./configure --config-cache --with-pydebug && make -s -j `nproc`",
17+
"docs": [
18+
"make",
19+
"--directory",
20+
"Doc",
21+
"venv",
22+
"html"
23+
]
24+
},
25+
"customizations": {
26+
"vscode": {
27+
"extensions": [
28+
// Highlighting for Parser/Python.asdl.
29+
"brettcannon.zephyr-asdl",
30+
// Highlighting for configure.ac.
31+
"maelvalais.autoconf",
32+
// C auto-complete.
33+
"ms-vscode.cpptools",
34+
// To view built docs.
35+
"ms-vscode.live-server"
36+
// https://github.com/microsoft/vscode-python/issues/18073
37+
// "ms-python.python"
38+
],
39+
"settings": {
40+
"C_Cpp.default.cStandard": "c11",
41+
"C_Cpp.default.defines": [
42+
"Py_BUILD_CORE"
43+
],
44+
// https://github.com/microsoft/vscode-cpptools/issues/10732
45+
"C_Cpp.errorSquiggles": "disabled",
46+
"editor.insertSpaces": true,
47+
"editor.rulers": [
48+
80
49+
],
50+
"editor.tabSize": 4,
51+
"editor.trimAutoWhitespace": true,
52+
"files.associations": {
53+
"*.h": "c"
54+
},
55+
"files.encoding": "utf8",
56+
"files.eol": "\n",
57+
"files.insertFinalNewline": true,
58+
"files.trimTrailingWhitespace": true,
59+
"python.analysis.diagnosticSeverityOverrides": {
60+
// Complains about shadowing the stdlib w/ the stdlib.
61+
"reportShadowedImports": "none",
62+
// Doesn't like _frozen_importlib.
63+
"reportMissingImports": "none"
64+
},
65+
"python.analysis.extraPaths": [
66+
"Lib"
67+
],
68+
"python.defaultInterpreterPath": "./python",
69+
"[restructuredtext]": {
70+
"editor.tabSize": 3
71+
}
72+
}
73+
}
74+
}
75+
}

.github/workflows/doc.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ jobs:
5353
- name: 'Build HTML documentation'
5454
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
5555

56+
# Add pull request annotations for Sphinx nitpicks (missing references)
57+
- name: 'Get list of changed files'
58+
id: changed_files
59+
uses: Ana06/[email protected]
60+
with:
61+
filter: "Doc/**"
62+
- name: 'Build changed files in nit-picky mode'
63+
continue-on-error: true
64+
run: |
65+
# Mark files the pull request modified
66+
touch ${{ steps.changed_files.outputs.added_modified }}
67+
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
68+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
69+
python Doc/tools/warnings-to-gh-actions.py
70+
71+
# Ensure some files always pass Sphinx nit-picky mode (no missing references)
72+
- name: 'Build known-good files in nit-picky mode'
73+
run: |
74+
# Mark files that must pass nit-picky
75+
python Doc/tools/touch-clean-files.py
76+
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
77+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
78+
5679
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
5780
doctest:
5881
name: 'Doctest'

Doc/c-api/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Printing and clearing
8686
8787
An exception must be set when calling this function.
8888
89-
.. c:function: void PyErr_DisplayException(PyObject *exc)
89+
.. c:function:: void PyErr_DisplayException(PyObject *exc)
9090
9191
Print the standard traceback display of ``exc`` to ``sys.stderr``, including
9292
chained exceptions and notes.

Doc/c-api/weakref.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,13 @@ as much as it can.
6767
.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
6868
6969
Similar to :c:func:`PyWeakref_GetObject`, but does no error checking.
70+
71+
72+
.. c:function:: void PyObject_ClearWeakRefs(PyObject *object)
73+
74+
This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler
75+
to clear weak references.
76+
77+
This iterates through the weak references for *object* and calls callbacks
78+
for those references which have one. It returns when all callbacks have
79+
been attempted.

Doc/howto/logging-cookbook.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -340,23 +340,27 @@ adding a ``filters`` section parallel to ``formatters`` and ``handlers``:
340340

341341
.. code-block:: json
342342
343-
"filters": {
344-
"warnings_and_below": {
345-
"()" : "__main__.filter_maker",
346-
"level": "WARNING"
343+
{
344+
"filters": {
345+
"warnings_and_below": {
346+
"()" : "__main__.filter_maker",
347+
"level": "WARNING"
348+
}
347349
}
348350
}
349351
350352
and changing the section on the ``stdout`` handler to add it:
351353

352354
.. code-block:: json
353355
354-
"stdout": {
355-
"class": "logging.StreamHandler",
356-
"level": "INFO",
357-
"formatter": "simple",
358-
"stream": "ext://sys.stdout",
359-
"filters": ["warnings_and_below"]
356+
{
357+
"stdout": {
358+
"class": "logging.StreamHandler",
359+
"level": "INFO",
360+
"formatter": "simple",
361+
"stream": "ext://sys.stdout",
362+
"filters": ["warnings_and_below"]
363+
}
360364
}
361365
362366
A filter is just a function, so we can define the ``filter_maker`` (a factory

Doc/library/asyncio-task.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,13 @@ Introspection
960960
.. versionadded:: 3.7
961961

962962

963+
.. function:: iscoroutine(obj)
964+
965+
Return ``True`` if *obj* is a coroutine object.
966+
967+
.. versionadded:: 3.4
968+
969+
963970
Task Object
964971
===========
965972

Doc/library/codeop.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ module instead.
1919

2020
There are two parts to this job:
2121

22-
#. Being able to tell if a line of input completes a Python statement: in
22+
#. Being able to tell if a line of input completes a Python statement: in
2323
short, telling whether to print '``>>>``' or '``...``' next.
2424

25-
#. Remembering which future statements the user has entered, so subsequent
25+
#. Remembering which future statements the user has entered, so subsequent
2626
input can be compiled with these in effect.
2727

2828
The :mod:`codeop` module provides a way of doing each of these things, and a way
@@ -33,19 +33,19 @@ To do just the former:
3333
.. function:: compile_command(source, filename="<input>", symbol="single")
3434

3535
Tries to compile *source*, which should be a string of Python code and return a
36-
code object if *source* is valid Python code. In that case, the filename
36+
code object if *source* is valid Python code. In that case, the filename
3737
attribute of the code object will be *filename*, which defaults to
38-
``'<input>'``. Returns ``None`` if *source* is *not* valid Python code, but is a
38+
``'<input>'``. Returns ``None`` if *source* is *not* valid Python code, but is a
3939
prefix of valid Python code.
4040

4141
If there is a problem with *source*, an exception will be raised.
4242
:exc:`SyntaxError` is raised if there is invalid Python syntax, and
4343
:exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal.
4444

4545
The *symbol* argument determines whether *source* is compiled as a statement
46-
(``'single'``, the default), as a sequence of statements (``'exec'``) or
46+
(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) or
4747
as an :term:`expression` (``'eval'``). Any other value will
48-
cause :exc:`ValueError` to be raised.
48+
cause :exc:`ValueError` to be raised.
4949

5050
.. note::
5151

@@ -69,5 +69,5 @@ To do just the former:
6969

7070
Instances of this class have :meth:`__call__` methods identical in signature to
7171
:func:`compile_command`; the difference is that if the instance compiles program
72-
text containing a ``__future__`` statement, the instance 'remembers' and
72+
text containing a :mod:`__future__` statement, the instance 'remembers' and
7373
compiles all subsequent program texts with the statement in force.

Doc/library/ctypes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ that they can be converted to the required C data type::
375375

376376
.. _ctypes-calling-variadic-functions:
377377

378-
Calling varadic functions
379-
^^^^^^^^^^^^^^^^^^^^^^^^^
378+
Calling variadic functions
379+
^^^^^^^^^^^^^^^^^^^^^^^^^^
380380

381381
On a lot of platforms calling variadic functions through ctypes is exactly the same
382382
as calling functions with a fixed number of parameters. On some platforms, and in
@@ -508,7 +508,7 @@ a string pointer and a char, and returns a pointer to a string::
508508

509509
If you want to avoid the ``ord("x")`` calls above, you can set the
510510
:attr:`argtypes` attribute, and the second argument will be converted from a
511-
single character Python bytes object into a C char::
511+
single character Python bytes object into a C char:
512512

513513
.. doctest::
514514

Doc/library/gc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ values but should not rebind them):
251251
are printed.
252252

253253
.. versionchanged:: 3.4
254-
Following :pep:`442`, objects with a :meth:`__del__` method don't end
254+
Following :pep:`442`, objects with a :meth:`~object.__del__` method don't end
255255
up in :attr:`gc.garbage` anymore.
256256

257257
.. data:: callbacks

0 commit comments

Comments
 (0)