Skip to content

Commit

Permalink
Merge branch 'main' into docs-floating-point
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored Jul 19, 2024
2 parents 3069f43 + 7b36b67 commit aceb089
Show file tree
Hide file tree
Showing 22 changed files with 500 additions and 141 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/reusable-tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
# Install clang-18
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --set clang /usr/bin/clang-18
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
sudo update-alternatives --set clang++ /usr/bin/clang++-18
sudo ./llvm.sh 17 # gh-121946: llvm-18 package is temporarily broken
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
sudo update-alternatives --set clang /usr/bin/clang-17
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
sudo update-alternatives --set clang++ /usr/bin/clang++-17
# Reduce ASLR to avoid TSAN crashing
sudo sysctl -w vm.mmap_rnd_bits=28
- name: TSAN Option Setup
Expand Down
5 changes: 2 additions & 3 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
# ---------------------

extensions = [
'asdl_highlight',
'c_annotations',
'escape4chm',
'glossary_search',
'peg_highlight',
'lexers',
'pyspecific',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
Expand Down Expand Up @@ -83,7 +82,7 @@
highlight_language = 'python3'

# Minimum version of sphinx required
needs_sphinx = '4.2'
needs_sphinx = '6.2.1'

# Create table of contents entries for domain objects (e.g. functions, classes,
# attributes, etc.). Default is True.
Expand Down
15 changes: 15 additions & 0 deletions Doc/tools/extensions/lexers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from .asdl_lexer import ASDLLexer
from .peg_lexer import PEGLexer


def setup(app):
# Used for highlighting Parser/Python.asdl in library/ast.rst
app.add_lexer("asdl", ASDLLexer)
# Used for highlighting Grammar/python.gram in reference/grammar.rst
app.add_lexer("peg", PEGLexer)

return {
"version": "1.0",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import sys
from pathlib import Path
from pygments.lexer import RegexLexer, bygroups, include
from pygments.token import Comment, Keyword, Name, Operator, Punctuation, Text

CPYTHON_ROOT = Path(__file__).resolve().parent.parent.parent.parent
sys.path.append(str(CPYTHON_ROOT / "Parser"))

from pygments.lexer import RegexLexer, bygroups, include, words
from pygments.token import (Comment, Keyword, Name, Operator,
Punctuation, Text)

from asdl import builtin_types
from sphinx.highlighting import lexers

class ASDLLexer(RegexLexer):
name = "ASDL"
Expand All @@ -34,7 +25,10 @@ class ASDLLexer(RegexLexer):
r"(\w+)(\*\s|\?\s|\s)(\w+)",
bygroups(Name.Builtin.Pseudo, Operator, Name),
),
(words(builtin_types), Name.Builtin),
# Keep in line with ``builtin_types`` from Parser/asdl.py.
# ASDL's 4 builtin types are
# constant, identifier, int, string
('constant|identifier|int|string', Name.Builtin),
(r"attributes", Name.Builtin),
(
_name + _text_ws + "(=)",
Expand All @@ -46,8 +40,3 @@ class ASDLLexer(RegexLexer):
(r".", Text),
],
}


def setup(app):
lexers["asdl"] = ASDLLexer()
return {'version': '1.0', 'parallel_read_safe': True}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pygments.lexer import RegexLexer, bygroups, include
from pygments.token import Comment, Keyword, Name, Operator, Punctuation, Text

from sphinx.highlighting import lexers


class PEGLexer(RegexLexer):
"""Pygments Lexer for PEG grammar (.gram) files
Expand Down Expand Up @@ -79,8 +77,3 @@ class PEGLexer(RegexLexer):
(r".", Text),
],
}


def setup(app):
lexers["peg"] = PEGLexer()
return {"version": "1.0", "parallel_read_safe": True}
2 changes: 2 additions & 0 deletions Include/internal/pycore_ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ PyAPI_FUNC(void) _PyEval_FormatAwaitableError(PyThreadState *tstate, PyTypeObjec
PyAPI_FUNC(void) _PyEval_FormatExcCheckArg(PyThreadState *tstate, PyObject *exc, const char *format_str, PyObject *obj);
PyAPI_FUNC(void) _PyEval_FormatExcUnbound(PyThreadState *tstate, PyCodeObject *co, int oparg);
PyAPI_FUNC(void) _PyEval_FormatKwargsError(PyThreadState *tstate, PyObject *func, PyObject *kwargs);
PyAPI_FUNC(PyObject *) _PyEval_ImportFrom(PyThreadState *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyEval_ImportName(PyThreadState *, _PyInterpreterFrame *, PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *)_PyEval_MatchClass(PyThreadState *tstate, PyObject *subject, PyObject *type, Py_ssize_t nargs, PyObject *kwargs);
PyAPI_FUNC(PyObject *)_PyEval_MatchKeys(PyThreadState *tstate, PyObject *map, PyObject *keys);
PyAPI_FUNC(int) _PyEval_UnpackIterableStackRef(PyThreadState *tstate, _PyStackRef v, int argcnt, int argcntafter, _PyStackRef *sp);
Expand Down
16 changes: 11 additions & 5 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 23 additions & 20 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aceb089

Please sign in to comment.